Skip to content

Commit

Permalink
require name and amount and scope out remaining prizes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwang committed Jul 24, 2011
1 parent e90c3c2 commit 9a11806
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/prize.rb
@@ -1,4 +1,7 @@
class Prize < ActiveRecord::Base
validates_presence_of :name, :on => :create, :message => "can't be blank"
validates_presence_of :amount, :on => :create, :message => "can't be blank"

scope :remaining, where("amount > 0")

end

0 comments on commit 9a11806

Please sign in to comment.