Created
February 18, 2010 01:31
-
-
Save mguterl/307229 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
include Mongoid::Document | |
field :location | |
field :country | |
field :state | |
field :city | |
field :zip_code | |
field :lat, :type => Float | |
field :lng, :type => Float | |
belongs_to :locatable, :inverse_of => :locations | |
end | |
class User | |
include Mongoid::Document | |
# snip typical user fields | |
has_one :location | |
has_one :ideal_location, :class_name => "Location" | |
has_one :birthplace, :class_name => "Location" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment