diff options
author | Benjamin Quorning <bquorning@zendesk.com> | 2012-11-06 21:32:03 +0100 |
---|---|---|
committer | Benjamin Quorning <bquorning@zendesk.com> | 2012-11-06 21:32:03 +0100 |
commit | 344364990436d9fcb7e77d5deb1beeb9c34a2b85 (patch) | |
tree | bb96f77e28cf697c3e6ee10c65b70e74c8cd349e /actionpack/lib/action_controller/metal | |
parent | 478d80fd5788a4b3e7c8482bfd3713eef7d00884 (diff) | |
download | rails-344364990436d9fcb7e77d5deb1beeb9c34a2b85.tar.gz rails-344364990436d9fcb7e77d5deb1beeb9c34a2b85.tar.bz2 rails-344364990436d9fcb7e77d5deb1beeb9c34a2b85.zip |
Set @permitted on new instance when slicing parameters hash
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index bd0bcd23ff..da640502a2 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -259,7 +259,9 @@ module ActionController # params.slice(:a, :b) # => {"a"=>1, "b"=>2} # params.slice(:d) # => {} def slice(*keys) - self.class.new(super) + self.class.new(super).tap do |new_instance| + new_instance.instance_variable_set :@permitted, @permitted + end end # Returns an exact copy of the <tt>ActionController::Parameters</tt> |