Skip to content

Instantly share code, notes, and snippets.

@fredrikhenne
Forked from jacquescrocker/gist:464765
Created July 6, 2010 00:09
Show Gist options
  • Save fredrikhenne/464829 to your computer and use it in GitHub Desktop.
Save fredrikhenne/464829 to your computer and use it in GitHub Desktop.
class Client
include Mongoid::Document
field :name
field :description
field :version
references_many :contents
end
class Content
include Mongoid::Document
field :key
field :value
referenced_in :client
end
client = Client.create!(:name => 'border', :description => 'lala')
content = Content.create!(:key => 'help_about', :value => 'hello there')
client.content = content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment