Exception: ActiveRecord::HasManyThroughAssociationNotFoundError

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

Overview

:nodoc:

Defined Under Namespace

Classes: Correction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner_class = nil, reflection = nil) ⇒ HasManyThroughAssociationNotFoundError

Returns a new instance of HasManyThroughAssociationNotFoundError.



82
83
84
85
86
87
88
89
90
# File 'lib/active_record/associations.rb', line 82

def initialize(owner_class = nil, reflection = nil)
  if owner_class && reflection
    @owner_class = owner_class
    @reflection = reflection
    super("Could not find the association #{reflection.options[:through].inspect} in model #{owner_class.name}")
  else
    super("Could not find the association.")
  end
end

Instance Attribute Details

#owner_classObject (readonly)

Returns the value of attribute owner_class.



80
81
82
# File 'lib/active_record/associations.rb', line 80

def owner_class
  @owner_class
end

#reflectionObject (readonly)

Returns the value of attribute reflection.



80
81
82
# File 'lib/active_record/associations.rb', line 80

def reflection
  @reflection
end