Remove 'assigned but unused variable' warning

This commit is contained in:
Steve Klabnik 2012-09-18 16:53:36 +03:00
parent 56071b37d0
commit 88d578a11f
1 changed files with 2 additions and 1 deletions

View File

@ -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