rubocop: fix various Rubocop warnings.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
class UserFeedback < ApplicationRecord
|
||||
self.table_name = "user_feedback"
|
||||
|
||||
attr_accessor :disable_dmail_notification
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :creator, class_name: "User"
|
||||
attr_accessor :disable_dmail_notification
|
||||
validates_presence_of :body, :category
|
||||
validates_inclusion_of :category, :in => %w(positive negative neutral)
|
||||
validates :body, presence: true
|
||||
validates :category, presence: true, inclusion: { in: %w[positive negative neutral] }
|
||||
after_create :create_dmail, unless: :disable_dmail_notification
|
||||
after_update(:if => ->(rec) { CurrentUser.id != rec.creator_id}) do |rec|
|
||||
ModAction.log(%{#{CurrentUser.user.name} updated user feedback for "#{rec.user.name}":#{Routes.user_path(rec.user)}}, :user_feedback_update)
|
||||
|
||||
Reference in New Issue
Block a user