提交 d9490631 编写于 作者: N Neeraj Singh

minor rdoc cleanup for reflection methods

上级 6abc3618
......@@ -398,7 +398,7 @@ class ThroughReflection < AssociationReflection #:nodoc:
delegate :foreign_key, :foreign_type, :association_foreign_key,
:active_record_primary_key, :type, :to => :source_reflection
# Gets the source of the through reflection. It checks both a singularized
# Returns the source of the through reflection. It checks both a singularized
# and pluralized form for <tt>:belongs_to</tt> or <tt>:has_many</tt>.
#
# class Post < ActiveRecord::Base
......@@ -412,8 +412,7 @@ class ThroughReflection < AssociationReflection #:nodoc:
# end
#
# tags_reflection = Post.reflect_on_association(:tags)
#
# taggings_reflection = tags_reflection.source_reflection
# tags_reflection.source_reflection
# # => <ActiveRecord::Reflection::AssociationReflection: @macro=:belongs_to, @name=:tag, @active_record=Tagging, @plural_name="tags">
#
def source_reflection
......@@ -429,7 +428,8 @@ def source_reflection
# end
#
# tags_reflection = Post.reflect_on_association(:tags)
# taggings_reflection = tags_reflection.through_reflection
# tags_reflection.through_reflection
# # => <ActiveRecord::Reflection::AssociationReflection: @macro=:has_many, @name=:taggings, @active_record=Post, @plural_name="taggings">
#
def through_reflection
@through_reflection ||= active_record.reflect_on_association(options[:through])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册