Exception: ActiveRecord::AmbiguousSourceReflectionForThroughAssociation
- Inherits:
-
ActiveRecordError
- Object
- StandardError
- ActiveRecordError
- ActiveRecord::AmbiguousSourceReflectionForThroughAssociation
- Defined in:
- lib/active_record/associations.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(klass, macro, association_name, options, possible_sources) ⇒ AmbiguousSourceReflectionForThroughAssociation
constructor
A new instance of AmbiguousSourceReflectionForThroughAssociation.
Constructor Details
#initialize(klass, macro, association_name, options, possible_sources) ⇒ AmbiguousSourceReflectionForThroughAssociation
Returns a new instance of AmbiguousSourceReflectionForThroughAssociation.
204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/active_record/associations.rb', line 204 def initialize(klass, macro, association_name, , possible_sources) = .dup [:source] = possible_sources.first super("Ambiguous source reflection for through association. Please " \ "specify a :source directive on your declaration like:\n" \ "\n" \ " class #{klass} < ActiveRecord::Base\n" \ " #{macro} :#{association_name}, #{}\n" \ " end" ) end |