Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a subtle bug involving RAILS_ROOT

  • Loading branch information...
commit 8baba5f13ea67f62d78318490f833e43c9674664 1 parent dbb547a
@wycats wycats authored jeremy committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 railties/lib/rails/deprecation.rb
View
10 railties/lib/rails/deprecation.rb
@@ -17,11 +17,17 @@ def initialize(old, new)
def method_missing(meth, *args, &block)
ActiveSupport::Deprecation.warn("#{@old} is deprecated. Please use #{@new}") unless @warned
@warned = true
- @target.call.send(meth, *args, &block)
+
+ target = @target.call
+ if target.respond_to?(meth)
+ target.send(meth, *args, &block)
+ else
+ super
+ end
end
end
- DeprecatedConstant.deprecate("RAILS_ROOT", "Rails.root")
+ DeprecatedConstant.deprecate("RAILS_ROOT", "Rails.root.to_s")
DeprecatedConstant.deprecate("RAILS_ENV", "Rails.env")
DeprecatedConstant.deprecate("RAILS_DEFAULT_LOGGER", "Rails.logger")
end
Please sign in to comment.
Something went wrong with that request. Please try again.