DEV: Update to lastest rubocop-discourse

This commit is contained in:
Loïc Guitaut
2024-05-27 12:27:13 +02:00
committed by Loïc Guitaut
parent 3b6d4c830f
commit 2a28cda15c
164 changed files with 269 additions and 263 deletions

View File

@@ -42,7 +42,7 @@ module Chat
def dismiss_retention_reminder
params.require(:chatable_type)
guardian.ensure_can_chat!
unless Chat::Channel.chatable_types.include?(params[:chatable_type])
if Chat::Channel.chatable_types.exclude?(params[:chatable_type])
raise Discourse::InvalidParameters
end

View File

@@ -6,7 +6,7 @@ module Jobs
def execute(args)
reason = args[:reason]
valid_reasons = %w[new edit]
return unless valid_reasons.include?(reason)
return if valid_reasons.exclude?(reason)
return if (timestamp = args[:timestamp]).blank?

View File

@@ -7,7 +7,7 @@ class AddThreadsEnabledSiteSetting < ActiveRecord::Migration[7.0]
threading_enabled_channels =
DB.query_single("SELECT name FROM chat_channels WHERE threading_enabled = 't'")
return unless threading_enabled_channels.present?
return if threading_enabled_channels.blank?
DB.exec("UPDATE site_settings SET value = 't' WHERE name = 'chat_threads_enabled'")
end