6 include DataMapper::Resource
7 include DataMapper::Validate
9 property :id, Fixnum, :serial => true
10 property :code, String, :length => 20, :nullable => false
11 property :name, String, :length => 100, :nullable => false
12 property :description, DataMapper::Types::Text
13 property :price, Float, :default => 0.0, :nullable => false
14 property :date_available, DateTime, :nullable => false
15 property :quantity, Fixnum, :default => 0, :nullable => false
16 property :size_width, Float, :default => 0.0, :nullable => false
17 property :size_height, Float, :default => 0.0, :nullable => false
18 property :size_depth, Float, :default => 0.0, :nullable => false
19 property :weight, Float, :default => 0.0, :nullable => false
20 property :is_discontinued, TrueClass, :default => false, :nullable => false
21 property :type, Class # single-table inheritance
23 one_to_many :order_line_items
24 one_to_many :wishlist_items #, :dependent => :destroy
26 validates_presence_of :name, :code