diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-01-24 13:50:24 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-06 16:57:34 -0800 |
commit | 7761ddbebb5627769cd9fa9d9f1ff5a072716b47 (patch) | |
tree | 6ae77b9cc48f899e010a7f7274a6ed3cc19e20f8 /actionview/lib/action_view | |
parent | 8fc73067e3c11810af374e886a41b9f3611a8873 (diff) | |
download | rails-7761ddbebb5627769cd9fa9d9f1ff5a072716b47.tar.gz rails-7761ddbebb5627769cd9fa9d9f1ff5a072716b47.tar.bz2 rails-7761ddbebb5627769cd9fa9d9f1ff5a072716b47.zip |
Deprecate finalizer configuration (it doesn't do anything)
Revert "Remove finalizer and configuration"
This reverts commit 9e7b4a3173788ea43b11e74a4d2f69a5f1565daa.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/railtie.rb | 13 | ||||
-rw-r--r-- | actionview/lib/action_view/template.rb | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/actionview/lib/action_view/railtie.rb b/actionview/lib/action_view/railtie.rb index 12bdc642d4..a25e1d3d02 100644 --- a/actionview/lib/action_view/railtie.rb +++ b/actionview/lib/action_view/railtie.rb @@ -6,10 +6,13 @@ require "rails" module ActionView # = Action View Railtie class Railtie < Rails::Engine # :nodoc: + NULL_OPTION = Object.new + config.action_view = ActiveSupport::OrderedOptions.new config.action_view.embed_authenticity_token_in_remote_forms = nil config.action_view.debug_missing_translation = true config.action_view.default_enforce_utf8 = nil + config.action_view.finalize_compiled_template_methods = NULL_OPTION config.eager_load_namespaces << ActionView @@ -45,6 +48,16 @@ module ActionView end end + initializer "action_view.finalize_compiled_template_methods" do |app| + ActiveSupport.on_load(:action_view) do + option = app.config.action_view.delete(:finalize_compiled_template_methods) + + if option != NULL_OPTION + ActiveSupport::Deprecation.warn "action_view.finalize_compiled_template_methods is deprecated and has no effect" + end + end + end + initializer "action_view.logger" do ActiveSupport.on_load(:action_view) { self.logger ||= Rails.logger } end diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 69e28770eb..37f476e554 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -2,6 +2,7 @@ require "active_support/core_ext/object/try" require "active_support/core_ext/kernel/singleton_class" +require "active_support/deprecation" require "thread" require "delegate" @@ -10,6 +11,14 @@ module ActionView class Template extend ActiveSupport::Autoload + def self.finalize_compiled_template_methods + ActiveSupport::Deprecation.warn "ActionView::Template.finalize_compiled_template_methods is deprecated and has no effect" + end + + def self.finalize_compiled_template_methods=(_) + ActiveSupport::Deprecation.warn "ActionView::Template.finalize_compiled_template_methods= is deprecated and has no effect" + end + # === Encodings in ActionView::Template # # ActionView::Template is one of a few sources of potential |