Created
April 29, 2010 13:01
-
-
Save gjnoonan/383560 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 Address | |
include MongoMapper::EmbeddedDocument | |
key :street | |
key :town | |
key :county | |
key :postcode | |
end | |
class EmailAddress | |
include MongoMapper::EmbeddedDocument | |
key :name, String | |
end | |
class Person | |
include MongoMapper::Document | |
key :first_name, String | |
key :last_name, String | |
key :home_address, Address | |
key :work_email_address, EmailAddress | |
key :home_email_address, EmailAddress | |
end | |
class PeriodOfAbscence | |
include MongoMapper::EmbeddedDocument | |
key :start_date, Date | |
key :end_date, Date | |
key :reason, String | |
end | |
class Employee < Person | |
end | |
class Parent < Person | |
key :work_address, Address | |
many :children | |
end | |
class Child < Person | |
many :parents | |
key :emergency_contact, Person | |
key :dob, Date | |
end | |
class Company | |
key :name, String | |
key :address, Address | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment