class

ActiveRecord::AssociationTypeMismatch

v2.0.3 - Show latest stable - Superclass: ActiveRecordError

Raised when object assigned to association is of incorrect type.

Example:

class Ticket < ActiveRecord::Base

  has_many :patches

end

class Patch < ActiveRecord::Base

  belongs_to :ticket

end

and somewhere in the code:

@ticket.patches << Comment.new(:content => "Please attach tests to your patch.") @ticket.save

Files

  • activerecord/lib/active_record/base.rb