spec/models/animal.rb in datamapper-0.2.4 vs spec/models/animal.rb in datamapper-0.2.5
- old
+ new
@@ -1,8 +1,12 @@
-class Animal < DataMapper::Base
- property :name, :string, :default => "No Name"
+class Animal #< DataMapper::Base
+ include DataMapper::Persistence
+
+ property :name, :string, :default => "No Name", :index => :unique
property :notes, :text
property :nice, :boolean
has_one :favourite_fruit, :class => 'Fruit', :foreign_key => 'devourer_id'
has_and_belongs_to_many :exhibits
+
+ DEFAULT_LIMIT = 5
end
\ No newline at end of file