File tree Expand file tree Collapse file tree 5 files changed +14
-1
lines changed
railties/test/application Expand file tree Collapse file tree 5 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 26
26
require "active_support"
27
27
require "active_support/rails"
28
28
require "active_model/version"
29
+ require "active_model/deprecator"
29
30
30
31
module ActiveModel
31
32
extend ActiveSupport ::Autoload
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ def self . deprecator # :nodoc:
5
+ @deprecator ||= ActiveSupport ::Deprecation . new
6
+ end
7
+ end
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ class Railtie < Rails::Railtie # :nodoc:
9
9
10
10
config . active_model = ActiveSupport ::OrderedOptions . new
11
11
12
+ initializer "active_model.deprecator" do |app |
13
+ app . deprecators [ :active_model ] = ActiveModel . deprecator
14
+ end
15
+
12
16
initializer "active_model.secure_password" do
13
17
ActiveModel ::SecurePassword . min_cost = Rails . env . test?
14
18
end
Original file line number Diff line number Diff line change 4
4
require "active_model"
5
5
6
6
# Show backtraces for deprecated behavior for quicker cleanup.
7
- ActiveSupport :: Deprecation . debug = true
7
+ ActiveModel . deprecator . debug = true
8
8
9
9
# Disable available locale checks to avoid warnings running the test suite.
10
10
I18n . enforce_available_locales = false
Original file line number Diff line number Diff line change @@ -3898,6 +3898,7 @@ def new(app); self; end
3898
3898
assert_equal ActionText . deprecator , Rails . application . deprecators [ :action_text ]
3899
3899
assert_equal ActionView . deprecator , Rails . application . deprecators [ :action_view ]
3900
3900
assert_equal ActiveJob . deprecator , Rails . application . deprecators [ :active_job ]
3901
+ assert_equal ActiveModel . deprecator , Rails . application . deprecators [ :active_model ]
3901
3902
assert_equal ActiveRecord . deprecator , Rails . application . deprecators [ :active_record ]
3902
3903
assert_equal ActiveStorage . deprecator , Rails . application . deprecators [ :active_storage ]
3903
3904
assert_equal ActiveSupport . deprecator , Rails . application . deprecators [ :active_support ]
You can’t perform that action at this time.
0 commit comments