Skip to content

Commit

Permalink
fix validating
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuynhut committed Feb 6, 2012
1 parent 76f3ede commit 02f5d12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/review.rb
Expand Up @@ -3,7 +3,8 @@ class Review < ActiveRecord::Base
belongs_to :user, class_name: 'Spree::User'

validates_presence_of :review
validates_presence_of :user_id, :title, :review
validates_presence_of :user
validates_presence_of :product
validates_numericality_of :rating, :only_integer => true

scope :approved, lambda {|*args| {:conditions => "approved = 't'"}}
Expand Down

0 comments on commit 02f5d12

Please sign in to comment.