Class: ThinkingSphinx::ActiveRecord::JoinAssociation

Inherits:
ActiveRecord::Associations::JoinDependency::JoinAssociation
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/join_association.rb

Instance Method Summary collapse

Instance Method Details

#build_constraint(klass, table, key, foreign_table, foreign_key) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/thinking_sphinx/active_record/join_association.rb', line 6

def build_constraint(klass, table, key, foreign_table, foreign_key)
  constraint = super

  constraint = constraint.and(
    foreign_table[reflection.options[:foreign_type]].eq(
      base_klass.base_class.name
    )
  ) if reflection.options[:sphinx_internal_filtered]

  constraint
end