diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-05-23 18:36:13 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-10-10 00:02:52 -0300 |
commit | c396a8c991ba1143b33e844118765f7a1ca22666 (patch) | |
tree | e5491aa5adaa8b1d938f452940858bf74c189174 | |
parent | 79a5ea9eadb4d43b62afacedc0706cbe88c54496 (diff) | |
download | rails-c396a8c991ba1143b33e844118765f7a1ca22666.tar.gz rails-c396a8c991ba1143b33e844118765f7a1ca22666.tar.bz2 rails-c396a8c991ba1143b33e844118765f7a1ca22666.zip |
Remove deprecated comparing support with `ActionController::Parameters`
-rw-r--r-- | actionpack/CHANGELOG.md | 5 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 9 | ||||
-rw-r--r-- | actionpack/test/controller/parameters/accessors_test.rb | 8 |
3 files changed, 5 insertions, 17 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 9049c2cdd6..c23dbfbb42 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,8 @@ +* Remove deprecated support to comparing a `ActionController::Parameters` + with a `Hash`. + + *Rafael Mendonça França* + * Remove deprecated support to `:text` in `render`. *Rafael Mendonça França* diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 387c2aa0b9..9883f109f7 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -151,15 +151,6 @@ module ActionController 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 diff --git a/actionpack/test/controller/parameters/accessors_test.rb b/actionpack/test/controller/parameters/accessors_test.rb index 8a522b2df8..2893eb7b91 100644 --- a/actionpack/test/controller/parameters/accessors_test.rb +++ b/actionpack/test/controller/parameters/accessors_test.rb @@ -131,14 +131,6 @@ class ParametersAccessorsTest < ActiveSupport::TestCase assert_not @params[:person].values_at(:name).first.permitted? end - test "equality with a hash is deprecated" do - hash1 = { foo: :bar } - params1 = ActionController::Parameters.new(hash1) - assert_deprecated("will be removed in Rails 5.1") do - assert(params1 == hash1) - end - end - test "is equal to Parameters instance with same params" do params1 = ActionController::Parameters.new(a: 1, b: 2) params2 = ActionController::Parameters.new(a: 1, b: 2) |