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

@ -278,7 +278,7 @@ class ImportScripts::Smf2 < ImportScripts::Base
attachment[:file_hash],
attachment[:filename],
)
raise "Attachment for post #{post[:id]} failed: #{attachment[:filename]}" unless path.present?
raise "Attachment for post #{post[:id]} failed: #{attachment[:filename]}" if path.blank?
upload = create_upload(post[:user_id], path, attachment[:filename])
unless upload.persisted?
raise "Attachment for post #{post[:id]} failed: #{upload.errors.full_messages.join(", ")}"
@ -378,7 +378,7 @@ class ImportScripts::Smf2 < ImportScripts::Base
pattern, emitter = *p
body.gsub!(pattern) do |s|
next s if (num = $~[:num].to_i - 1) < 0
next s unless (upload = attachments[num]).present?
next s if (upload = attachments[num]).blank?
use_count[num] += 1
instance_exec(upload, &emitter)
end