Skip to content

Commit baa345e

Browse files
authored
Merge pull request rails#53374 from rails/rm-deprecations
Remove all deprecations
2 parents 9a6054a + fcf641a commit baa345e

File tree

47 files changed

+341
-916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+341
-916
lines changed

actionpack/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove `Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`.
2+
3+
*Rafael Mendonça França*
4+
15
* Improve `ActionController::TestCase` to expose a binary encoded `request.body`.
26

37
The rack spec clearly states:

actionpack/lib/action_controller/metal/strong_parameters.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,6 @@ class Parameters
261261
cattr_accessor :always_permitted_parameters, default: %w( controller action )
262262

263263
class << self
264-
def allow_deprecated_parameters_hash_equality
265-
ActionController.deprecator.warn <<-WARNING.squish
266-
`Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality` is
267-
deprecated and will be removed in Rails 8.0.
268-
WARNING
269-
end
270-
271-
def allow_deprecated_parameters_hash_equality=(value)
272-
ActionController.deprecator.warn <<-WARNING.squish
273-
`Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`
274-
is deprecated and will be removed in Rails 8.0.
275-
WARNING
276-
end
277-
278264
def nested_attribute?(key, value) # :nodoc:
279265
/\A-?\d+\z/.match?(key) && (value.is_a?(Hash) || value.is_a?(Parameters))
280266
end

actionpack/lib/action_controller/railtie.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ class Railtie < Rails::Railtie # :nodoc:
4848
end
4949

5050
ActionController::Parameters.action_on_unpermitted_parameters = action_on_unpermitted_parameters
51-
52-
unless options.allow_deprecated_parameters_hash_equality.nil?
53-
ActionController::Parameters.allow_deprecated_parameters_hash_equality =
54-
options.allow_deprecated_parameters_hash_equality
55-
end
5651
end
5752
end
5853

@@ -85,7 +80,6 @@ class Railtie < Rails::Railtie # :nodoc:
8580
:action_on_unpermitted_parameters,
8681
:always_permitted_parameters,
8782
:wrap_parameters_by_default,
88-
:allow_deprecated_parameters_hash_equality
8983
)
9084

9185
filtered_options.each do |k, v|

actionpack/lib/action_dispatch/routing/route_set.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,14 @@ def add_route(mapping, name)
659659
if route.segment_keys.include?(:controller)
660660
ActionDispatch.deprecator.warn(<<-MSG.squish)
661661
Using a dynamic :controller segment in a route is deprecated and
662-
will be removed in Rails 7.2.
662+
will be removed in Rails 8.1.
663663
MSG
664664
end
665665

666666
if route.segment_keys.include?(:action)
667667
ActionDispatch.deprecator.warn(<<-MSG.squish)
668668
Using a dynamic :action segment in a route is deprecated and
669-
will be removed in Rails 7.2.
669+
will be removed in Rails 8.1.
670670
MSG
671671
end
672672

actionview/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
* Remove deprecated support to passing a content to void tag elements on the `tag` builder.
2+
3+
*Rafael Mendonça França*
4+
5+
* Remove deprecated support to passing `nil` to the `model:` argument of `form_with`.
6+
7+
*Rafael Mendonça França*
8+
9+
110
## Rails 8.0.0.beta1 (September 26, 2024) ##
211

312
* Enable DependencyTracker to evaluate renders with trailing interpolation.

actionview/lib/action_view/helpers/form_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ def apply_form_for_options!(object, options) # :nodoc:
754754
# form_with(**options.merge(builder: LabellingFormBuilder), &block)
755755
# end
756756
def form_with(model: false, scope: nil, url: nil, format: nil, **options, &block)
757-
ActionView.deprecator.warn("Passing nil to the :model argument is deprecated and will raise in Rails 8.0") if model.nil?
757+
raise ArgumentError, "Passed nil to the :model argument, expect an object or false" if model.nil?
758758

759759
options = { allow_method_names_outside_object: true, skip_default_ids: !form_with_generates_ids }.merge!(options)
760760

actionview/lib/action_view/helpers/tag_helper.rb

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ class TagBuilder # :nodoc:
4747
include CaptureHelper
4848
include OutputSafetyHelper
4949

50-
def deprecated_void_content(name)
51-
ActionView.deprecator.warn <<~TEXT
52-
Putting content inside a void element (#{name}) is invalid
53-
according to the HTML5 spec, and so it is being deprecated
54-
without replacement. In Rails 8.0, passing content as a
55-
positional argument will raise, and using a block will have
56-
no effect.
57-
TEXT
58-
end
59-
6050
def self.define_element(name, code_generator:, method_name: name)
6151
return if method_defined?(name)
6252

@@ -71,13 +61,8 @@ def self.define_element(name, code_generator:, method_name: name)
7161
def self.define_void_element(name, code_generator:, method_name: name)
7262
code_generator.class_eval do |batch|
7363
batch << "\n" <<
74-
"def #{method_name}(content = nil, escape: true, **options, &block)" <<
75-
" if content || block" <<
76-
" deprecated_void_content(#{name.inspect})" <<
77-
" tag_string(#{name.inspect}, content, options, escape: escape, &block)" <<
78-
" else" <<
79-
" self_closing_tag_string(#{name.inspect}, options, escape, '>')" <<
80-
" end" <<
64+
"def #{method_name}(escape: true, **options, &block)" <<
65+
" self_closing_tag_string(#{name.inspect}, options, escape, '>')" <<
8166
"end"
8267
end
8368
end

actionview/test/template/form_helper/form_with_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def url_for(object)
340340
end
341341

342342
def test_form_with_when_given_nil_model_argument
343-
assert_deprecated(ActionView.deprecator) do
343+
assert_raises(ArgumentError) do
344344
form_with(model: nil) do
345345
end
346346
end

actionview/test/template/tag_helper_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def test_tag_builder_void_tag
2727
end
2828

2929
def test_tag_builder_void_tag_with_forced_content
30-
assert_deprecated(ActionView.deprecator) do
31-
assert_equal "<br>some content</br>", tag.br("some content")
30+
assert_raises(ArgumentError) do
31+
tag.br("some content")
3232
end
3333
end
3434

3535
def test_tag_builder_void_tag_with_empty_content
36-
assert_deprecated(ActionView.deprecator) do
37-
assert_equal "<br></br>", tag.br("")
36+
assert_raises(ArgumentError) do
37+
tag.br("")
3838
end
3939
end
4040

activejob/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
* Remove deprecated `config.active_job.use_big_decimal_serializer`.
2+
3+
*Rafael Mendonça França*
4+
5+
16
## Rails 8.0.0.beta1 (September 26, 2024) ##
27

38
* Deprecate `sucker_punch` as an adapter option.

0 commit comments

Comments
 (0)