1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails/deprecation.rb
Sergey Nartimov 04d6ebb467 refactor RAILS_CACHE deprecation
that was introduced in 6f8159c421
2012-01-19 02:20:32 +03:00

18 lines
407 B
Ruby

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