Require name and cost when creating a purchase.
This commit is contained in:
parent
2fc8218d29
commit
813987b44d
|
@ -1,2 +1,4 @@
|
|||
class Purchase < ActiveRecord::Base
|
||||
validates :name, presence: true
|
||||
validates :cost, numericality: { greater_than: 0 }
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue