Created
May 23, 2011 06:30
-
-
Save tsujigiri/986323 to your computer and use it in GitHub Desktop.
mcmire's Geokit branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the insights! Got it working now.