Skip to content

Loading…

warning removed: shadowing outer local variable - value #7919

Merged
merged 1 commit into from

3 participants

@arunagw
Ruby on Rails member

No description provided.

@rafaelfranca rafaelfranca merged commit 1957687 into rails:master
@rafaelfranca
Ruby on Rails member

Thanks

@spastorino
Ruby on Rails member

if value shadows an outer local variable I would change the name to something else meaningful instead of appending a _

@rafaelfranca
Ruby on Rails member

I could not think in anything better than value. Maybe is better to change the name of the block variable inside the each

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 12, 2012
  1. @arunagw
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_controller/metal/strong_parameters.rb
View
4 actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -200,8 +200,8 @@ def permit(*filters)
case filter
when Symbol, String then
if has_key?(filter)
- value = self[filter]
- params[filter] = value unless Hash === value
+ _value = self[filter]
+ params[filter] = _value unless Hash === _value
end
keys.grep(/\A#{Regexp.escape(filter)}\(\di\)\z/) { |key| params[key] = self[key] }
when Hash then
Something went wrong with that request. Please try again.