Class: ThinkingSphinx::ActiveRecord::AssociationProxy::AttributeMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/association_proxy/attribute_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(attribute, foreign_key) ⇒ AttributeMatcher

Returns a new instance of AttributeMatcher.



4
5
6
# File 'lib/thinking_sphinx/active_record/association_proxy/attribute_matcher.rb', line 4

def initialize(attribute, foreign_key)
  @attribute, @foreign_key = attribute, foreign_key.to_s
end

Instance Method Details

#matches?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/thinking_sphinx/active_record/association_proxy/attribute_matcher.rb', line 8

def matches?
  return false if many?

  column_name_matches? || attribute_name_matches? || multi_singular_match?
end