5 include DataMapper::Resource
6 include DataMapper::Validate
9 many_to_one :order_user
12 property :first_name, String, :length => 50, :nullable => false
13 property :last_name, String, :length => 50, :nullable => false
14 property :telephone, String, :length => 20
15 property :address, String, :nullable => false
16 property :city, String, :length => 50
17 property :state, String, :length => 30
18 property :zip, String, :length => 10
21 validates_presence_of :order_user_id, :country_id
22 validates_presence_of :zip, :message => "#{ERROR_EMPTY} If you live in a country that doesn't have postal codes please enter '00000'."
23 validates_presence_of :telephone, :message => ERROR_EMPTY
24 validates_presence_of :first_name, :message => ERROR_EMPTY
25 validates_presence_of :last_name, :message => ERROR_EMPTY
26 validates_presence_of :address, :message => ERROR_EMPTY
28 validates_length_of :first_name, :maximum => 50
29 validates_length_of :last_name, :maximum => 50
30 validates_length_of :address, :maximum => 255