diff options
Diffstat (limited to 'railties/lib/rails/deprecation.rb')
-rw-r--r-- | railties/lib/rails/deprecation.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/lib/rails/deprecation.rb b/railties/lib/rails/deprecation.rb new file mode 100644 index 0000000000..c5811b2629 --- /dev/null +++ b/railties/lib/rails/deprecation.rb @@ -0,0 +1,18 @@ +require 'active_support/deprecation/proxy_wrappers' + +module Rails + class DeprecatedConstant < ActiveSupport::Deprecation::DeprecatedConstantProxy + def self.deprecate(old, current) + constant = new(old, current) + eval "::#{old} = constant" + end + + private + + def target + ::Kernel.eval @new_const.to_s + end + end + + DeprecatedConstant.deprecate('RAILS_CACHE', '::Rails.cache') +end |