diff --git a/railties/lib/rails/deprecation.rb b/railties/lib/rails/deprecation.rb index c5811b2629..89f54069e9 100644 --- a/railties/lib/rails/deprecation.rb +++ b/railties/lib/rails/deprecation.rb @@ -3,7 +3,8 @@ require 'active_support/deprecation/proxy_wrappers' module Rails class DeprecatedConstant < ActiveSupport::Deprecation::DeprecatedConstantProxy def self.deprecate(old, current) - constant = new(old, current) + # double assignment is used to avoid "assigned but unused variable" warning + constant = constant = new(old, current) eval "::#{old} = constant" end