aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector/inflections.rb
diff options
context:
space:
mode:
authorNick LaMuro <nicklamuro@gmail.com>2017-10-23 11:11:59 -0500
committerNick LaMuro <nicklamuro@gmail.com>2017-10-28 17:32:32 -0500
commitb2545e4106c8388cb2a4d9e06c31954e5ee2c948 (patch)
treec79b1de9b9e1f140c54fccdadb4755ae7a295310 /activesupport/lib/active_support/inflector/inflections.rb
parenta822fc513cb3c98207a14fc203c973e13f42e306 (diff)
downloadrails-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/inflector/inflections.rb')
-rw-r--r--activesupport/lib/active_support/inflector/inflections.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/inflector/inflections.rb b/activesupport/lib/active_support/inflector/inflections.rb
index 6cfa8bb5aa..0450a4be4c 100644
--- a/activesupport/lib/active_support/inflector/inflections.rb
+++ b/activesupport/lib/active_support/inflector/inflections.rb
@@ -4,6 +4,7 @@ require "concurrent/map"
require "active_support/core_ext/array/prepend_and_append"
require "active_support/core_ext/regexp"
require "active_support/i18n"
+require "active_support/deprecation"
module ActiveSupport
module Inflector
@@ -66,8 +67,9 @@ module ActiveSupport
@__instance__[locale] ||= new
end
- attr_reader :plurals, :singulars, :uncountables, :humans,
- :acronyms, :acronym_regex
+ attr_reader :plurals, :singulars, :uncountables, :humans, :acronyms, :acronym_regex
+ deprecate :acronym_regex
+
attr_reader :acronyms_camelize_regex, :acronyms_underscore_regex # :nodoc:
def initialize