File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed
lib/active_support/core_ext/module Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change
1
+ * Remove deprecated support to setting ` attr_internal_naming_format ` with a ` @ ` prefix.
2
+
3
+ * Rafael Mendonça França*
4
+
1
5
* Remove deprecated ` ActiveSupport::ProxyObject ` .
2
6
3
7
* Rafael Mendonça França*
Original file line number Diff line number Diff line change @@ -24,14 +24,13 @@ class << self
24
24
25
25
def attr_internal_naming_format = ( format )
26
26
if format . start_with? ( "@" )
27
- ActiveSupport . deprecator . warn <<~MESSAGE
28
- Setting `attr_internal_naming_format` with a `@` prefix is deprecated and will be removed in Rails 8.0 .
27
+ raise ArgumentError , <<~MESSAGE . squish
28
+ Setting `attr_internal_naming_format` with a `@` prefix is not supported .
29
29
30
30
You can simply replace #{ format . inspect } by #{ format . delete_prefix ( "@" ) . inspect } .
31
31
MESSAGE
32
-
33
- format = format . delete_prefix ( "@" )
34
32
end
33
+
35
34
@attr_internal_naming_format = format
36
35
end
37
36
end
Original file line number Diff line number Diff line change @@ -44,12 +44,11 @@ def test_accessor
44
44
assert_nothing_raised { assert_equal 1 , @instance . foo }
45
45
end
46
46
47
- def test_naming_format_deprecation
47
+ def test_invalid_naming_format
48
48
assert_equal "_%s" , Module . attr_internal_naming_format
49
- assert_deprecated ( ActiveSupport . deprecator ) do
49
+ assert_raises ( ArgumentError ) do
50
50
Module . attr_internal_naming_format = "@___%s"
51
51
end
52
- assert_equal "___%s" , Module . attr_internal_naming_format
53
52
end
54
53
55
54
def test_naming_format
Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ Please refer to the [Changelog][active-support] for detailed changes.
142
142
143
143
* Remove deprecated ` ActiveSupport::ProxyObject ` .
144
144
145
+ * Remove deprecated support to setting ` attr_internal_naming_format ` with a ` @ ` prefix.
146
+
145
147
### Deprecations
146
148
147
149
### Notable changes
You can’t perform that action at this time.
0 commit comments