couchrest_model/spec/fixtures/more/cat.rb
Sam Lown c280b3a29b Renaming to CouchRest Model
Refactored basic directory structure.
Moved to ActiveSupport for Validations and Callbacks.
Cleaned up older code, and removed support for text property types.
2010-06-20 22:01:11 +02:00

20 lines
387 B
Ruby

class CatToy < Hash
include ::CouchRest::Model::CastedModel
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