Require name and cost when creating a purchase.

This commit is contained in:
James Skemp 2014-08-10 06:32:25 -05:00
parent 2fc8218d29
commit 813987b44d
1 changed files with 2 additions and 0 deletions

View File

@ -1,2 +1,4 @@
class Purchase < ActiveRecord::Base
validates :name, presence: true
validates :cost, numericality: { greater_than: 0 }
end