This commit is contained in:
r888888888
2013-05-07 13:27:21 -07:00
parent 2e370f9907
commit a031a4eba8
3 changed files with 3 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ class UserFeedback < ActiveRecord::Base
before_validation :initialize_creator, :on => :create
attr_accessible :body, :user_id, :category, :user_name
validates_presence_of :user, :creator, :body, :category
validates_inclusion_of :category, :in => %w(positive negative neutral)
validate :creator_is_gold
validate :user_is_not_creator
after_create :create_dmail