Permalink
Browse files

Merge pull request #16373 from eileencodes/deprecate-reflection-sourc…

…e_macro

Deprecate source_macro
  • Loading branch information...
2 parents 3bf2a4c + 01c80a1 commit 8dda066fbc408de699051fec1defc9fafb39365c @rafaelfranca rafaelfranca committed Aug 2, 2014
Showing with 15 additions and 1 deletion.
  1. +8 −0 activerecord/CHANGELOG.md
  2. +7 −1 activerecord/lib/active_record/reflection.rb
@@ -1,3 +1,11 @@
+* Deprecate `Reflection#source_macro`
+
+ `Reflection#source_macro` is no longer needed in Active Record
+ source so it has been deprecated. Code that used `source_macro`
+ was removed in #16353.
+
+ *Eileen M. Uchtitelle*, *Aaron Patterson*
+
* No verbose backtrace by db:drop when database does not exist.
Fixes #16295.
@@ -152,7 +152,11 @@ def join_keys(assoc_klass)
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 @@ def join_keys(assoc_klass)
# 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

0 comments on commit 8dda066

Please sign in to comment.