mirror of https://github.com/rails/rails
Add ActionText.deprecator
This commit adds `ActionText.deprecator`, and adds it to `Rails.application.deprecators` so that it can be configured via settings such as `config.active_support.report_deprecations`.
This commit is contained in:
parent
f434310b3b
commit
b2bc006815
|
@ -3,6 +3,8 @@
|
|||
require "active_support"
|
||||
require "active_support/rails"
|
||||
|
||||
require "action_text/deprecator"
|
||||
|
||||
require "nokogiri"
|
||||
|
||||
module ActionText
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActionText
|
||||
def self.deprecator # :nodoc:
|
||||
@deprecator ||= ActiveSupport::Deprecation.new
|
||||
end
|
||||
end
|
|
@ -19,6 +19,10 @@ module ActionText
|
|||
#{root}/app/models
|
||||
)
|
||||
|
||||
initializer "action_text.deprecator" do |app|
|
||||
app.deprecators[:action_text] = ActionText.deprecator
|
||||
end
|
||||
|
||||
initializer "action_text.attribute" do
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
include ActionText::Attribute
|
||||
|
|
|
@ -3895,6 +3895,7 @@ module ApplicationTests
|
|||
assert_equal ActionDispatch.deprecator, Rails.application.deprecators[:action_dispatch]
|
||||
assert_equal ActionMailbox.deprecator, Rails.application.deprecators[:action_mailbox]
|
||||
assert_equal ActionMailer.deprecator, Rails.application.deprecators[:action_mailer]
|
||||
assert_equal ActionText.deprecator, Rails.application.deprecators[:action_text]
|
||||
assert_equal ActionView.deprecator, Rails.application.deprecators[:action_view]
|
||||
assert_equal ActiveJob.deprecator, Rails.application.deprecators[:active_job]
|
||||
assert_equal ActiveRecord.deprecator, Rails.application.deprecators[:active_record]
|
||||
|
|
Loading…
Reference in New Issue