File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ def disallowed_behavior=(disallowed_behavior)
69
69
set_option ( :disallowed_behavior , disallowed_behavior )
70
70
end
71
71
72
+ # Sets the disallowed deprecation warnings for all deprecators in this
73
+ # collection.
74
+ #
75
+ # See ActiveSupport::Deprecation::Disallowed#disallowed_warnings=.
76
+ def disallowed_warnings = ( disallowed_warnings )
77
+ set_option ( :disallowed_warnings , disallowed_warnings )
78
+ end
79
+
72
80
# Silences all deprecators in this collection for the duration of the
73
81
# given block.
74
82
#
Original file line number Diff line number Diff line change @@ -88,9 +88,7 @@ class Railtie < Rails::Railtie # :nodoc:
88
88
end
89
89
90
90
if disallowed_warnings = app . config . active_support . disallowed_deprecation_warnings
91
- app . deprecators . each do |deprecator |
92
- deprecator . disallowed_warnings = disallowed_warnings
93
- end
91
+ app . deprecators . disallowed_warnings = disallowed_warnings
94
92
end
95
93
end
96
94
end
Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ class DeprecationTest < ActiveSupport::TestCase
63
63
@deprecators . each { |deprecator | assert_equal [ callback ] , deprecator . disallowed_behavior }
64
64
end
65
65
66
+ test "#disallowed_warnings= applies to each deprecator" do
67
+ @deprecators . disallowed_warnings = :all
68
+ @deprecators . each { |deprecator | assert_equal :all , deprecator . disallowed_warnings }
69
+ end
70
+
66
71
test "#silence silences each deprecator" do
67
72
@deprecators . each { |deprecator | assert_not_silencing ( deprecator ) }
68
73
You can’t perform that action at this time.
0 commit comments