Method: ActiveRecord::Reflection::ThroughReflection#through_reflection

Defined in:
lib/active_record/reflection.rb

#through_reflectionObject

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)
taggings_reflection = tags_reflection.through_reflection


360
361
362
# File 'lib/active_record/reflection.rb', line 360

def through_reflection
  @through_reflection ||= active_record.reflect_on_association(options[:through])
end