couchrest_model/spec/fixtures/more/cat.rb

20 lines
387 B
Ruby
Raw Normal View History

2010-04-16 02:51:59 +02:00
class CatToy < Hash
include ::CouchRest::Model::CastedModel
2010-04-16 02:51:59 +02:00
property :name
validates_presence_of :name
end
class Cat < CouchRest::Model::Base
# Set the default database to use
use_database DB
property :name, :accessible => true
property :toys, [CatToy], :default => [], :accessible => true
property :favorite_toy, CatToy, :accessible => true
property :number
end