diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-20 22:09:31 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-20 22:09:32 -0200 |
commit | 9a7411a92b52022f881280d953a77c424b0f9a78 (patch) | |
tree | 1f0395584cbf60ed6ff24a31f3e57645f483aa44 /actionpack | |
parent | e0cc7ab3ffba84e36aa57dbecbe7c1331c2adde5 (diff) | |
download | rails-9a7411a92b52022f881280d953a77c424b0f9a78.tar.gz rails-9a7411a92b52022f881280d953a77c424b0f9a78.tar.bz2 rails-9a7411a92b52022f881280d953a77c424b0f9a78.zip |
Refactor grep call to remove .each
Grep already yields the matching keys to the given block.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 4193083f88..0d84fbb62b 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -382,7 +382,7 @@ module ActionController 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 |