rubocop: fix various Rubocop warnings.

This commit is contained in:
evazion
2021-06-16 18:24:42 -05:00
parent cfe471e0b5
commit 07e23204b6
99 changed files with 412 additions and 374 deletions

View File

@@ -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)