instance method
==
Ruby on Rails 5.0.7.2
Since v5.0.7.2Signature
==(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 240
def ==(other)
if other.respond_to?(:permitted?)
self.permitted? == other.permitted? && self.parameters == other.parameters
elsif other.is_a?(Hash)
ActiveSupport::Deprecation.warn <<-WARNING.squish
Comparing equality between `ActionController::Parameters` and a
`Hash` is deprecated and will be removed in Rails 5.1. Please only do
comparisons between instances of `ActionController::Parameters`. If
you need to compare to a hash, first convert it using
`ActionController::Parameters#new`.
WARNING
@parameters == other.with_indifferent_access
else
@parameters == other
end
end
Defined in actionpack/lib/action_controller/metal/strong_parameters.rb line 240
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Parameters