From 0b7067d8497c4d832b32233888ce973ab4357e5d Mon Sep 17 00:00:00 2001 From: Nikita Afanasenko Date: Mon, 29 Oct 2012 19:22:59 +0400 Subject: Provide a call stack for deprecation warnings where needed. It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly. --- railties/lib/rails/application/configuration.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 7df517de71..ab10523861 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -88,9 +88,10 @@ module Rails end def threadsafe! - ActiveSupport::Deprecation.warn "config.threadsafe! is deprecated. Rails applications " \ - "behave by default as thread safe in production as long as config.cache_classes and " \ - "config.eager_load are set to true" + message = "config.threadsafe! is deprecated. Rails applications " \ + "behave by default as thread safe in production as long as config.cache_classes and " \ + "config.eager_load are set to true" + ActiveSupport::Deprecation.warn(message, caller) @cache_classes = true @eager_load = true self -- cgit v1.2.3