Permalink
Browse files

Merge pull request #7680 from steveklabnik/master

Remove 'assigned but unused variable' warning
  • Loading branch information...
rafaelfranca committed Sep 18, 2012
2 parents 9f2d1a1 + 88d578a commit 39c3bda28684514487217beb0b6099890a6867d2
Showing with 2 additions and 1 deletion.
  1. +2 −1 railties/lib/rails/deprecation.rb
@@ -3,7 +3,8 @@
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

0 comments on commit 39c3bda

Please sign in to comment.