less error info for the user
[opensuse:software-o-o.git] / app / models / order.rb
1 # Class Order (db table orders)
2 # Schema version 3
3 #
4 #+------------+--------------+------+-----+---------+----------------+
5 #| Field      | Type         | Null | Key | Default | Extra          |
6 #+------------+--------------+------+-----+---------+----------------+
7 #| id         | int(11)      | NO   | PRI | NULL    | auto_increment | 
8 #| title      | varchar(255) | NO   |     |         |                | 
9 #| name       | varchar(255) | NO   |     |         |                | 
10 #| company    | varchar(255) | YES  |     | NULL    |                | 
11 #| street1    | varchar(255) | NO   |     |         |                | 
12 #| street2    | varchar(255) | YES  |     | NULL    |                | 
13 #| zip        | varchar(255) | NO   |     |         |                | 
14 #| city       | varchar(255) | NO   |     |         |                | 
15 #| county     | varchar(255) | YES  |     | NULL    |                | 
16 #| country    | varchar(255) | NO   |     |         |                | 
17 #| phone      | varchar(255) | NO   |     |         |                | 
18 #| email      | varchar(255) | NO   |     |         |                | 
19 #| amount     | int(11)      | NO   |     |         |                | 
20 #| reason     | text         | NO   |     |         |                | 
21 #| deadline   | varchar(255) | NO   |     |         |                | 
22 #| created_at | datetime     | YES  |     | NULL    |                | 
23 #| updated_at | datetime     | YES  |     | NULL    |                | 
24 #+------------+--------------+------+-----+---------+----------------+
25
26 class Order < ActiveRecord::Base
27   validates_presence_of :title, :name, :street1, :zip, :city, :country,
28     :phone, :email, :amount, :reason, :deadline
29
30   validates_numericality_of :amount
31 end