Skip to content

Commit f432e12

Browse files
committed
Merge pull request rails#23678 from kamipo/remove_deprecated_never_unpermitted_params
Remove `const_missing` which fallback to deprecated `NEVER_UNPERMITTED_PARAMS`
2 parents 3c96a6e + 7433836 commit f432e12

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

actionpack/lib/action_controller/metal/strong_parameters.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,6 @@ class Parameters
122122
cattr_accessor :always_permitted_parameters
123123
self.always_permitted_parameters = %w( controller action )
124124

125-
def self.const_missing(const_name)
126-
return super unless const_name == :NEVER_UNPERMITTED_PARAMS
127-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
128-
`ActionController::Parameters::NEVER_UNPERMITTED_PARAMS` has been deprecated.
129-
Use `ActionController::Parameters.always_permitted_parameters` instead.
130-
MSG
131-
132-
always_permitted_parameters
133-
end
134-
135125
# Returns a new instance of <tt>ActionController::Parameters</tt>.
136126
# Also, sets the +permitted+ attribute to the default value of
137127
# <tt>ActionController::Parameters.permit_all_parameters</tt>.

actionpack/test/controller/parameters/always_permitted_parameters_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ def teardown
1212
ActionController::Parameters.always_permitted_parameters = %w( controller action )
1313
end
1414

15-
test "shows deprecations warning on NEVER_UNPERMITTED_PARAMS" do
16-
assert_deprecated do
17-
ActionController::Parameters::NEVER_UNPERMITTED_PARAMS
18-
end
19-
end
20-
2115
test "returns super on missing constant other than NEVER_UNPERMITTED_PARAMS" do
2216
ActionController::Parameters.superclass.stub :const_missing, "super" do
2317
assert_equal "super", ActionController::Parameters::NON_EXISTING_CONSTANT

0 commit comments

Comments
 (0)