diff options
Diffstat (limited to 'railties/lib/rails')
-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 |