提交 9a7411a9 编写于 作者: C Carlos Antonio da Silva

Refactor grep call to remove .each

Grep already yields the matching keys to the given block.
上级 e0cc7ab3
......@@ -382,7 +382,7 @@ def permitted_scalar_filter(params, key)
params[key] = self[key]
end
keys.grep(/\A#{Regexp.escape(key)}\(\d+[if]?\)\z/).each do |k|
keys.grep(/\A#{Regexp.escape(key)}\(\d+[if]?\)\z/) do |k|
if permitted_scalar?(self[k])
params[k] = self[k]
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册