From 01c80a12d49ffa4999861ed4b57f72e682d42a64 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Wed, 30 Jul 2014 21:02:57 -0400 Subject: Deprecate source_macro `source_macro` is no longer used in any ActiveRecord code. I've chosen to deprecate it because it was not marked as nodoc and may be in use outside of rails source. --- activerecord/lib/active_record/reflection.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 575e588f35..10a75530fd 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -152,7 +152,11 @@ module ActiveRecord JoinKeys.new(foreign_key, active_record_primary_key) end - def source_macro; macro; end + def source_macro + ActiveSupport::Deprecation.warn("ActiveRecord::Base.source_macro is deprecated and " \ + "will be removed without replacement.") + macro + end end # Base class for AggregateReflection and AssociationReflection. Objects of # AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods. @@ -738,6 +742,8 @@ Joining, Preloading and eager loading of these associations is deprecated and wi # The macro used by the source association def source_macro + ActiveSupport::Deprecation.warn("ActiveRecord::Base.source_macro is deprecated and " \ + "will be removed without replacement.") source_reflection.source_macro end -- cgit v1.2.3