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. --- activerecord/lib/active_record/attribute_methods/serialization.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/attribute_methods/serialization.rb') diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb index 9994a81ede..d8fe4afd54 100644 --- a/activerecord/lib/active_record/attribute_methods/serialization.rb +++ b/activerecord/lib/active_record/attribute_methods/serialization.rb @@ -45,7 +45,8 @@ module ActiveRecord end def serialized_attributes - ActiveSupport::Deprecation.warn("Instance level serialized_attributes method is deprecated, please use class level method.") + message = "Instance level serialized_attributes method is deprecated, please use class level method." + ActiveSupport::Deprecation.warn(message, caller) defined?(@serialized_attributes) ? @serialized_attributes : self.class.serialized_attributes end -- cgit v1.2.3