diff options
author | Eugene Baranov <Eugene_Baranov@comcast.com> | 2019-07-14 00:06:45 +0300 |
---|---|---|
committer | Eugene Baranov <Eugene_Baranov@comcast.com> | 2019-07-14 00:06:45 +0300 |
commit | 80aaa111884247e6aa17b7bbab268c7719847521 (patch) | |
tree | 6ad94fdd0bf5462013c4bd11e8f7d8f2e42c79d4 /actionpack/lib | |
parent | a8dfec903bd8cd3b7df9f9d5fbb7100520049302 (diff) | |
download | rails-80aaa111884247e6aa17b7bbab268c7719847521.tar.gz rails-80aaa111884247e6aa17b7bbab268c7719847521.tar.bz2 rails-80aaa111884247e6aa17b7bbab268c7719847521.zip |
Add hash method to ActionController::Parameters
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 <tt>ActiveSupport::HashWithIndifferentAccess</tt> # representation of the parameters with all unpermitted keys removed. |