Exception: BigRecord::HasManyThroughSourceAssociationNotFoundError
- Inherits:
-
BigRecordError
- Object
- StandardError
- BigRecordError
- BigRecord::HasManyThroughSourceAssociationNotFoundError
- Defined in:
- lib/big_record/ar_associations.rb
Overview
:nodoc:
Instance Method Summary
-
- (HasManyThroughSourceAssociationNotFoundError) initialize(reflection)
constructor
A new instance of HasManyThroughSourceAssociationNotFoundError.
Constructor Details
- (HasManyThroughSourceAssociationNotFoundError) initialize(reflection)
A new instance of HasManyThroughSourceAssociationNotFoundError
30 31 32 33 34 35 |
# File 'lib/big_record/ar_associations.rb', line 30 def initialize(reflection) through_reflection = reflection.through_reflection source_reflection_names = reflection.source_reflection_names source_associations = reflection.through_reflection.klass.reflect_on_all_associations.collect { |a| a.name.inspect } super("Could not find the source association(s) #{source_reflection_names.collect(&:inspect).to_sentence :connector => 'or'} in model #{through_reflection.klass}. Try 'has_many #{reflection.name.inspect}, :through => #{through_reflection.name.inspect}, :source => <name>'. Is it one of #{source_associations.to_sentence :connector => 'or'}?") end |