Exception: ActiveRecord::HasAndBelongsToManyAssociationForeignKeyNeeded
- Inherits:
-
ActiveRecordError
- Object
- StandardError
- ActiveRecordError
- ActiveRecord::HasAndBelongsToManyAssociationForeignKeyNeeded
- Defined in:
- activerecord/lib/active_record/associations.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(reflection) ⇒ HasAndBelongsToManyAssociationForeignKeyNeeded
constructor
A new instance of HasAndBelongsToManyAssociationForeignKeyNeeded.
Constructor Details
#initialize(reflection) ⇒ HasAndBelongsToManyAssociationForeignKeyNeeded
Returns a new instance of HasAndBelongsToManyAssociationForeignKeyNeeded.
77 78 79 |
# File 'activerecord/lib/active_record/associations.rb', line 77 def initialize(reflection) super("Cannot create self referential has_and_belongs_to_many association on '#{reflection.class_name rescue nil}##{reflection.name rescue nil}'. :association_foreign_key cannot be the same as the :foreign_key.") end |