Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a location to a object??? #114

Open
ChrisCPO opened this issue Jan 16, 2017 · 0 comments
Open

add a location to a object??? #114

ChrisCPO opened this issue Jan 16, 2017 · 0 comments

Comments

@ChrisCPO
Copy link

ChrisCPO commented Jan 16, 2017

How do you add a location to an object? I have

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])?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant