Skip to content

Commit

Permalink
order モデルにバリデーションを実装
Browse files Browse the repository at this point in the history
  • Loading branch information
kyanny committed Jan 22, 2010
1 parent 33b0695 commit 791792f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions depot/app/models/order.rb
Expand Up @@ -6,4 +6,7 @@ class Order < ActiveRecord::Base
["クレジットカード", "cc"],
["注文書", "po"],
]

validates_presence_of :name, :address, :email, :pay_type
validates_inclusion_of :pay_type, :in => PAYMENT_TYPES.map { |disp, value| value }
end

0 comments on commit 791792f

Please sign in to comment.