Skip to content

Commit 50c8bf7

Browse files
author
Ryan Bigg
committed
Section 1.2.7: Validations
1 parent 8560d09 commit 50c8bf7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
class Purchase < ActiveRecord::Base
2+
validates :name, presence: true
3+
validates :cost, numericality: { greater_than: 0 }
24
end

0 commit comments

Comments
 (0)