Exception: ActiveRecord::AmbiguousSourceReflectionForThroughAssociation

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(klass, macro, association_name, options, possible_sources) ⇒ AmbiguousSourceReflectionForThroughAssociation

Returns a new instance of AmbiguousSourceReflectionForThroughAssociation.



121
122
123
124
125
126
127
128
129
130
131
132
# File 'activerecord/lib/active_record/associations.rb', line 121

def initialize(klass, macro, association_name, options, possible_sources)
  example_options = options.dup
  example_options[: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}, #{example_options}\n" \
        "  end"
       )
end