class Resource < ApplicationRecord # Universally Unique Identifier :uuid include UUIDParameter belongs_to :agent has_and_belongs_to_many :sections # Figure out the requested property name def method_missing(name, *args, &block) Rails.logger.info("method_missing: #{name} // #{feature['properties'][name.to_s]}") if feature['properties'].key?(name.to_s) feature['properties'][name.to_s] else case name.to_s when 'lon', 'longitude' feature['geometry']['coordinates'].first when 'lat', 'latitude' feature['geometry']['coordinates'].last when 'geo_type' feature['geometry']['type'] else super end end end end