Exception: ActiveRecord::HasManyThroughSourceAssociationMacroError

Inherits:
ActiveRecordError
  • Object
show all
Defined in:
lib/active_record/associations.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(reflection) ⇒ HasManyThroughSourceAssociationMacroError

Returns a new instance of HasManyThroughSourceAssociationMacroError.



36
37
38
39
40
# File 'lib/active_record/associations.rb', line 36

def initialize(reflection)
  through_reflection = reflection.through_reflection
  source_reflection  = reflection.source_reflection
  super("Invalid source reflection macro :#{source_reflection.macro}#{" :through" if source_reflection.options[:through]} for has_many #{reflection.name.inspect}, :through => #{through_reflection.name.inspect}.  Use :source to specify the source reflection.")
end