From 80aaa111884247e6aa17b7bbab268c7719847521 Mon Sep 17 00:00:00 2001 From: Eugene Baranov Date: Sun, 14 Jul 2019 00:06:45 +0300 Subject: Add hash method to ActionController::Parameters --- actionpack/lib/action_controller/metal/strong_parameters.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/lib/action_controller/metal') diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 6a07a73d94..6fbd52dd51 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -259,6 +259,11 @@ module ActionController @parameters == other end end + alias eql? == + + def hash + [@parameters.hash, @permitted].hash + end # Returns a safe ActiveSupport::HashWithIndifferentAccess # representation of the parameters with all unpermitted keys removed. -- cgit v1.2.3