Fixes #1266
This commit is contained in:
@@ -3,7 +3,8 @@ class UserFeedback < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :creator, :class_name => "User"
|
||||
before_validation :initialize_creator, :on => :create
|
||||
attr_accessible :body, :user_id, :category, :user_name
|
||||
attr_accessor :disable_dmail_notification
|
||||
attr_accessible :body, :user_id, :category, :user_name, :disable_dmail_notification
|
||||
validates_presence_of :user, :creator, :body, :category
|
||||
validates_inclusion_of :category, :in => %w(positive negative neutral)
|
||||
validate :creator_is_gold
|
||||
@@ -74,8 +75,10 @@ class UserFeedback < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def create_dmail
|
||||
body = %{#{creator_name} created a "#{category} record":/user_feedbacks?search[user_id]=#{user_id} for your account. #{body}}
|
||||
Dmail.create_split(:to_id => user_id, :title => "Your user record has been updated", :body => body)
|
||||
unless disable_dmail_notification
|
||||
body = %{#{creator_name} created a "#{category} record":/user_feedbacks?search[user_id]=#{user_id} for your account. #{body}}
|
||||
Dmail.create_split(:to_id => user_id, :title => "Your user record has been updated", :body => body)
|
||||
end
|
||||
end
|
||||
|
||||
def creator_is_gold
|
||||
|
||||
Reference in New Issue
Block a user