Skip to content

Instantly share code, notes, and snippets.

@arunthampi
Created July 7, 2009 15:38
Show Gist options
  • Save arunthampi/142161 to your computer and use it in GitHub Desktop.
Save arunthampi/142161 to your computer and use it in GitHub Desktop.
class Pet < ActiveCouch::Base
has :name, :which_is => :text, :with_default_value => 'Tom'
end
class Person < ActiveCouch::Base
has :name, :which_is => :text, :with_default_value => 'McLovin'
has :age, :which_is => :number, :with_default_value => 0
has_many :dogs, :class => Pet
has_many :cats, :class => Pet
has_many :pets # Automagically assumes that 'pets' corresponds to the class Pet
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment