Module: Extensions::HasManyInverseThrough::ActiveRecord::Associations::HasManyThroughAssociation::PrependMethods

Defined in:
lib/extensions/has_many_inverse_through/active_record/associations/has_many_through_association.rb

Instance Method Summary collapse

Instance Method Details

#build_through_record(record) ⇒ Object


4
5
6
7
8
# File 'lib/extensions/has_many_inverse_through/active_record/associations/has_many_through_association.rb', line 4

def build_through_record(record)
  association = reflection.inverse_through
  through_record = record.public_send(association.name) if association
  through_record || super
end