Skip to content
This repository
Browse code

We don't need the each call since grep take a block and yield each match

to the block.

Thanks @tenderlove
  • Loading branch information...
commit 14b66d6628158c9a0e08d19bb570f89fd76026cd 1 parent 639efb9
Rafael Mendonça França authored
2  actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -178,7 +178,7 @@ def permit(*filters)
178 178
         case filter
179 179
         when Symbol, String then
180 180
           params[filter] = self[filter] if has_key?(filter)
181  
-          keys.grep(/\A#{Regexp.escape(filter)}\(\di\)\z/).each { |key| params[key] = self[key] }
  181
+          keys.grep(/\A#{Regexp.escape(filter)}\(\di\)\z/) { |key| params[key] = self[key] }
182 182
         when Hash then
183 183
           self.slice(*filter.keys).each do |key, values|
184 184
             return unless values

0 notes on commit 14b66d6

Please sign in to comment.
Something went wrong with that request. Please try again.