Skip to content

Instantly share code, notes, and snippets.

@tsujigiri
Created May 23, 2011 06:30
Show Gist options
  • Save tsujigiri/986323 to your computer and use it in GitHub Desktop.
Save tsujigiri/986323 to your computer and use it in GitHub Desktop.
mcmire's Geokit branch
class Location < ActiveRecord::Base
has_many :foos
acts_as_mappable default_units: :kms
end
class Foo < ActiveRecord::Base
belongs_to :location
acts_as_mappable through: :location
end
foos = Foo.geo_scope(origin: "berlin")
foos.first.distance
# => NoMethodError: undefined method `distance' for #<Foo:0x00000005ba50b8>
@tsujigiri
Copy link
Author

Thanks for the insights! Got it working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment