Exception: ActiveRecord::HasManyThroughCantAssociateNewRecords

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(owner, reflection) ⇒ HasManyThroughCantAssociateNewRecords

Returns a new instance of HasManyThroughCantAssociateNewRecords.



62
63
64
# File 'activerecord/lib/active_record/associations.rb', line 62

def initialize(owner, reflection)
  super("Cannot associate new records through '#{owner.class.name}##{reflection.name}' on '#{reflection.source_reflection.class_name rescue nil}##{reflection.source_reflection.name rescue nil}'. Both records must have an id in order to create the has_many :through record associating them.")
end