Exception: ActiveRecord::AssociationNotFoundError

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(record = nil, association_name = nil) ⇒ AssociationNotFoundError

Returns a new instance of AssociationNotFoundError.



10
11
12
13
14
15
16
# File 'lib/active_record/associations.rb', line 10

def initialize(record = nil, association_name = nil)
  if record && association_name
    super("Association named '#{association_name}' was not found on #{record.class.name}; perhaps you misspelled it?")
  else
    super("Association was not found.")
  end
end