Permalink
Browse files

Set @permitted on new instance when slicing parameters hash

  • Loading branch information...
1 parent 478d80f commit 344364990436d9fcb7e77d5deb1beeb9c34a2b85 @bquorning bquorning committed Nov 6, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -259,7 +259,9 @@ def fetch(key, *args)
# 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>

0 comments on commit 3443649

Please sign in to comment.