File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,10 +25,22 @@ def self.config(&block)
2525 @config
2626 end
2727
28+ def self . deprecator
29+ @deprecator ||= deprecator_instance
30+ end
31+
32+ # TODO: refactor when support for Rails < 7.1.0 is dropped
33+ def self . deprecator_instance
34+ if Gem ::Version . new ( Rails . version ) >= Gem ::Version . new ( '7.1.0' )
35+ ActiveSupport ::Deprecation . new ( "6.0.0" , "Qa" )
36+ else
37+ Rails . logger
38+ end
39+ end
40+
2841 def self . deprecation_warning ( in_msg : nil , msg :)
29- return if Rails . env == 'test'
3042 in_msg = in_msg . present? ? "In #{ in_msg } , " : ''
31- warn "[DEPRECATED] #{ in_msg } #{ msg } It will be removed in the next major release."
43+ deprecator . warn "#{ in_msg } #{ msg } It will be removed in the next major release."
3244 end
3345
3446 # Raised when the authority is not valid
Original file line number Diff line number Diff line change @@ -17,5 +17,12 @@ class Engine < ::Rails::Engine
1717 Rails . autoloaders . main . ignore ( Rails . root . join ( 'lib' , 'generators' ) )
1818 end
1919 end
20+
21+ # Allow main application to configure deprecation behavior
22+ if Gem ::Version . new ( Rails . version ) >= Gem ::Version . new ( '7.1.0' )
23+ initializer "qa.deprecator" do |app |
24+ app . deprecators [ :qa ] = Qa . deprecator
25+ end
26+ end
2027 end
2128end
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ Gem::Specification.new do |s|
1818 s . metadata = { "rubygems_mfa_required" => "true" }
1919
2020 s . add_dependency 'activerecord-import'
21- s . add_dependency 'deprecation'
2221 s . add_dependency 'faraday' , '< 3.0' , '!= 2.0.0'
2322 s . add_dependency 'geocoder'
2423 s . add_dependency 'ldpath'
You can’t perform that action at this time.
0 commit comments