From bd54e1956b939feb605d1f6c05d3e01943933c08 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Sun, 27 Jul 2014 19:35:00 -0400 Subject: [ci skip] Fix documentation for @macro and reflection types Since `@macro` doesn't exist anymore and these reflections are no longer AssociationReflections but their own types of reflections based on macro I updated the documentation to match the changes I made in #16089 and #16198. An `AssociationReflection` that had a `@macro` of `:has_many` now is a `HasManyReflection` --- .../associations/join_dependency/join_association.rb | 2 +- activerecord/lib/active_record/reflection.rb | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index a0e83c0a02..719eff9acc 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -95,7 +95,7 @@ module ActiveRecord # end # # If I execute `Physician.joins(:appointments).to_a` then - # reflection # => # + # reflection # => # # table # => # # key # => physician_id # foreign_table # => # diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 86eef9ca36..1672128aa3 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -167,9 +167,12 @@ module ActiveRecord # AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods. # # MacroReflection - # AggregateReflection # AssociationReflection - # ThroughReflection + # AggregateReflection + # HasManyReflection + # HasOneReflection + # BelongsToReflection + # ThroughReflection class MacroReflection < AbstractReflection # Returns the name of the macro. # @@ -647,7 +650,7 @@ Joining, Preloading and eager loading of these associations is deprecated and wi # # tags_reflection = Post.reflect_on_association(:tags) # tags_reflection.source_reflection - # # => + # # => # def source_reflection through_reflection.klass._reflect_on_association(source_reflection_name) @@ -663,7 +666,7 @@ Joining, Preloading and eager loading of these associations is deprecated and wi # # tags_reflection = Post.reflect_on_association(:tags) # tags_reflection.through_reflection - # # => + # # => # def through_reflection active_record._reflect_on_association(options[:through]) @@ -683,8 +686,8 @@ Joining, Preloading and eager loading of these associations is deprecated and wi # # tags_reflection = Post.reflect_on_association(:tags) # tags_reflection.chain - # # => [:taggings}, @active_record=Post>, - # ] + # # => [, + # ] # def chain @chain ||= begin -- cgit v1.2.3