Created
August 3, 2010 18:58
-
-
Save joslynesser/506921 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 Application | |
include Mongoid::Document | |
embeds_many :items | |
embeds_many :templates | |
references_many :users, :stored_as => :array, :inverse_of => :applications | |
end | |
class User | |
include Mongoid::Document | |
references_many :applications, :stored_as => :array, :inverse_of => :users | |
end | |
class Template | |
include Mongoid::Document | |
embedded_in :application, :inverse_of => :templates | |
embeds_many :fields | |
references_many :items | |
end | |
class Field | |
include Mongoid::Document | |
embedded_in :template, :inverse_of => :fields | |
end | |
class Item | |
include Mongoid::Document | |
include Mongoid::Tree | |
embedded_in :application, :inverse_of => :items | |
referenced_in :template | |
embeds_many :data | |
end | |
class Datum | |
include Mongoid::Document | |
embedded_in :item, :inverse_of => :data | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment