Skip to content

Commit

Permalink
Section 1.2.7: Validations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Bigg committed Oct 26, 2014
1 parent 8560d09 commit 50c8bf7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions things_i_bought/app/models/purchase.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
class Purchase < ActiveRecord::Base
validates :name, presence: true
validates :cost, numericality: { greater_than: 0 }
end

0 comments on commit 50c8bf7

Please sign in to comment.