mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:07:43 +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
@ -199,7 +199,7 @@ module Chat
|
||||
def call(instance, context)
|
||||
method = instance.method(method_name)
|
||||
args = {}
|
||||
args = context.to_h if !method.arity.zero?
|
||||
args = context.to_h if method.arity.nonzero?
|
||||
context[result_key] = Context.build
|
||||
instance.instance_exec(**args, &method)
|
||||
end
|
||||
|
Reference in New Issue
Block a user