instance method
==
Ruby on Rails 7.1.6
Since v5.2.8.1Signature
==(other)
Returns true if another Parameters object contains the same content and permitted flag.
Parameters
-
otherreq
Source
# File actionpack/lib/action_controller/metal/strong_parameters.rb, line 283
def ==(other)
if other.respond_to?(:permitted?)
permitted? == other.permitted? && parameters == other.parameters
else
if self.class.allow_deprecated_parameters_hash_equality && Hash === other
ActionController.deprecator.warn <<-WARNING.squish
Comparing equality between `ActionController::Parameters` and a
`Hash` is deprecated and will be removed in Rails 7.2. Please only do
comparisons between instances of `ActionController::Parameters`. If
you need to compare to a hash, first convert it using
`ActionController::Parameters#new`.
To disable the deprecated behavior set
`Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false`.
WARNING
@parameters == other
else
super
end
end
end
Defined in actionpack/lib/action_controller/metal/strong_parameters.rb line 283
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Parameters