module ActiveRecord::Narcissus::ThroughReflection

Public Class Methods

new(delegate_reflection) click to toggle source
Calls superclass method
# File lib/active_record/narcissus/reflection.rb, line 22
def initialize(delegate_reflection)
  super
  delegate_reflection.klass = @klass
end

Public Instance Methods

klass() click to toggle source
Calls superclass method
# File lib/active_record/narcissus/reflection.rb, line 32
def klass
  @klass ||= through_klass.const_get(class_name)
rescue NameError
  super
end
through_klass() click to toggle source
# File lib/active_record/narcissus/reflection.rb, line 27
def through_klass
  through = delegate_reflection.options[:through]
  delegate_reflection.active_record.reflect_on_association(through).klass
end