class Location < ApplicationRecord
belongs_to :locationable, polymorphic: true
acts_as_mappable
end
the location class has the columns lng and lat. You would think this would work.
Location.new(orgin: "a zipcode" )
But that results in an error.(Origin is not an attribute). I'm I missing something. Can't find an answer in the docs.
I'm under the impression I can assign a location object that is acts_as_mappable given that object a physical location via this gem and then, do distance calculations between two objects. After reading though the docs this seems like this is an option, but the documentation for the is not well written. Where is a most basic use case? distance = Object.new(origin: [x,y]) - Object.new(origin: [x,y])?
How do you add a location to an object? I have
the location class has the columns lng and lat. You would think this would work.
But that results in an error.(Origin is not an attribute). I'm I missing something. Can't find an answer in the docs.
I'm under the impression I can assign a location object that is acts_as_mappable given that object a physical location via this gem and then, do distance calculations between two objects. After reading though the docs this seems like this is an option, but the documentation for the is not well written. Where is a most basic use case? distance = Object.new(origin: [x,y]) - Object.new(origin: [x,y])?