mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:21:23 +08:00
DEV: Enable unless
cops
We discussed the use of `unless` internally and decided to enforce available rules from rubocop to restrict its most problematic uses.
This commit is contained in:

committed by
Loïc Guitaut

parent
87de3c2319
commit
f7c57fbc19
@ -378,7 +378,7 @@ class ImportScripts::Smf2 < ImportScripts::Base
|
||||
AttachmentPatterns.each do |p|
|
||||
pattern, emitter = *p
|
||||
body.gsub!(pattern) do |s|
|
||||
next s unless (num = $~[:num].to_i - 1) >= 0
|
||||
next s if (num = $~[:num].to_i - 1) < 0
|
||||
next s unless (upload = attachments[num]).present?
|
||||
use_count[num] += 1
|
||||
instance_exec(upload, &emitter)
|
||||
|
Reference in New Issue
Block a user