diff options
author | wycats <wycats@gmail.com> | 2010-08-04 03:20:56 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-08-26 23:15:31 -0700 |
commit | 8baba5f13ea67f62d78318490f833e43c9674664 (patch) | |
tree | d65d0ede6c37f5478b55daa49d0cab78d048d18d | |
parent | dbb547a0565dd216089f35d82fcf17a655897603 (diff) | |
download | rails-8baba5f13ea67f62d78318490f833e43c9674664.tar.gz rails-8baba5f13ea67f62d78318490f833e43c9674664.tar.bz2 rails-8baba5f13ea67f62d78318490f833e43c9674664.zip |
Fix a subtle bug involving RAILS_ROOT
-rw-r--r-- | railties/lib/rails/deprecation.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/deprecation.rb b/railties/lib/rails/deprecation.rb index 924701a326..c32b748ffd 100644 --- a/railties/lib/rails/deprecation.rb +++ b/railties/lib/rails/deprecation.rb @@ -17,11 +17,17 @@ module Rails 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 |