instance method ==

Ruby on Rails 7.1.6

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

==(other)

Returns true if another Parameters object contains the same content and permitted flag.

Parameters

other req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close