Permalink
Browse files

Remove 'assigned but unused variable' warning

  • Loading branch information...
1 parent 56071b3 commit 88d578a11fc2755a9714234be99f5752dcc1b5aa @steveklabnik steveklabnik committed Sep 18, 2012
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 88d578a

Please sign in to comment.