Class: ThinkingSphinx::ActiveRecord::Index
- Inherits:
-
Riddle::Configuration::Index
- Object
- Riddle::Configuration::Index
- ThinkingSphinx::ActiveRecord::Index
show all
- Includes:
- Core::Index
- Defined in:
- lib/thinking_sphinx/active_record/index.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#document_id_for_key, #initialize, #interpret_definition!, #model, #render
Instance Attribute Details
#definition_block=(value) ⇒ Object
Sets the attribute definition_block
5
6
7
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 5
def definition_block=(value)
@definition_block = value
end
|
#reference ⇒ Object
Returns the value of attribute reference.
4
5
6
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 4
def reference
@reference
end
|
Instance Method Details
#append_source ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 7
def append_source
ThinkingSphinx::ActiveRecord::SQLSource.new(
model, source_options.merge(:position => sources.length)
).tap do |source|
sources << source
end
end
|
#delta? ⇒ Boolean
15
16
17
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 15
def delta?
@options[:delta?]
end
|
#delta_processor ⇒ Object
19
20
21
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 19
def delta_processor
@options[:delta_processor].try(:new, adapter)
end
|
#facets ⇒ Object
23
24
25
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 23
def facets
@facets ||= sources.collect(&:facets).flatten
end
|
#sources ⇒ Object
27
28
29
30
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 27
def sources
interpret_definition!
super
end
|
#unique_attribute_names ⇒ Object
32
33
34
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 32
def unique_attribute_names
attributes.collect(&:name)
end
|