diff options
author | Nick LaMuro <nicklamuro@gmail.com> | 2017-10-23 11:11:59 -0500 |
---|---|---|
committer | Nick LaMuro <nicklamuro@gmail.com> | 2017-10-28 17:32:32 -0500 |
commit | b2545e4106c8388cb2a4d9e06c31954e5ee2c948 (patch) | |
tree | c79b1de9b9e1f140c54fccdadb4755ae7a295310 /activesupport/lib/active_support/deprecation/constant_accessor.rb | |
parent | a822fc513cb3c98207a14fc203c973e13f42e306 (diff) | |
download | rails-b2545e4106c8388cb2a4d9e06c31954e5ee2c948.tar.gz rails-b2545e4106c8388cb2a4d9e06c31954e5ee2c948.tar.bz2 rails-b2545e4106c8388cb2a4d9e06c31954e5ee2c948.zip |
Deprecate ActiveSupport::Inflector#acronym_regex
To be removed in Rails 6.0 (default for the deprecate helper). Code
moved around as well for the ActiveSupport::Deprecation modules, since
it was dependent on ActiveSupport::Inflector being loaded for it to
work. By "lazy loading" the Inflector code from within the Deprecation
code, we can require ActiveSupport::Deprecation from
ActiveSupport::Inflector and not get a circular dependency issue.
Diffstat (limited to 'activesupport/lib/active_support/deprecation/constant_accessor.rb')
-rw-r--r-- | activesupport/lib/active_support/deprecation/constant_accessor.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation/constant_accessor.rb b/activesupport/lib/active_support/deprecation/constant_accessor.rb index 3d7eedf637..dd515cd6f4 100644 --- a/activesupport/lib/active_support/deprecation/constant_accessor.rb +++ b/activesupport/lib/active_support/deprecation/constant_accessor.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "active_support/inflector/methods" - module ActiveSupport class Deprecation # DeprecatedConstantAccessor transforms a constant into a deprecated one by @@ -29,6 +27,8 @@ module ActiveSupport # ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] module DeprecatedConstantAccessor def self.included(base) + require "active_support/inflector/methods" + extension = Module.new do def const_missing(missing_const_name) if class_variable_defined?(:@@_deprecated_constants) |