method
through_reflection
v4.2.7 -
Show latest stable
- Class:
ActiveRecord::Reflection::ThroughReflection
through_reflection()public
Returns the AssociationReflection object specified in the :through option of a HasManyThrough or HasOneThrough association.
class Post < ActiveRecord::Base has_many :taggings has_many :tags, through: :taggings end tags_reflection = Post.reflect_on_association(:tags) tags_reflection.through_reflection # => <ActiveRecord::Reflection::HasManyReflection: @name=:taggings, @active_record=Post, @plural_name="taggings">