Created
May 15, 2012 08:52
-
-
Save ni-ka/2700151 to your computer and use it in GitHub Desktop.
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 User | |
include MongoMapper::Document | |
key :uid, String, :required => true, :unique => true | |
one :profile | |
end | |
class Profile | |
include MongoMapper::EmbeddedDocument | |
embedded_in :user | |
many :industries | |
end | |
class Expertise | |
include MongoMapper::EmbeddedDocument | |
key :expertise, String, :required => true | |
key :proficiency, Fixnum | |
end | |
class Industry < Expertise | |
validates :expertise, :unique_expertise => true, | |
:inclusion => { :in => Profile::INDUSTRIES } | |
validates :proficiency, :inclusion => { :in => 0..4 }, | |
:presence => true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment