Class: ThinkingSphinx::ActiveRecord::Depolymorph::AssociationReflection

Inherits:
BaseReflection
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/depolymorph/association_reflection.rb

Overview

This custom association approach is only available in Rails 4.1-5.1. This behaviour is superseded by OverriddenReflection for Rails 5.2, and was preceded by ScopedReflection for Rails 4.0.

Instance Method Summary collapse

Methods inherited from BaseReflection

#initialize

Constructor Details

This class inherits a constructor from ThinkingSphinx::ActiveRecord::Depolymorph::BaseReflection

Instance Method Details

#callObject

Since Rails 4.2, the macro argument has been removed. The underlying behaviour remains the same, though.



11
12
13
14
15
16
17
# File 'lib/thinking_sphinx/active_record/depolymorph/association_reflection.rb', line 11

def call
  if explicit_macro?
    klass.new name, nil, options, reflection.active_record
  else
    klass.new reflection.macro, name, nil, options, reflection.active_record
  end
end