Class: ThinkingSphinx::ActiveRecord::Index

Inherits:
Riddle::Configuration::Index
  • Object
show all
Includes:
Core::Index
Defined in:
lib/thinking_sphinx/active_record/index.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Core::Index

#document_id_for_key, #initialize, #interpret_definition!, #model, #render

Instance Attribute Details

- (Object) definition_block=(value) (writeonly)

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

- (Object) reference (readonly)

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

- (Object) append_source



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

- (Boolean) delta?



15
16
17
# File 'lib/thinking_sphinx/active_record/index.rb', line 15

def delta?
  @options[:delta?]
end

- (Object) delta_processor



19
20
21
# File 'lib/thinking_sphinx/active_record/index.rb', line 19

def delta_processor
  @options[:delta_processor].try(:new, adapter)
end

- (Object) facets



23
24
25
# File 'lib/thinking_sphinx/active_record/index.rb', line 23

def facets
  @facets ||= sources.collect(&:facets).flatten
end

- (Object) sources



27
28
29
30
# File 'lib/thinking_sphinx/active_record/index.rb', line 27

def sources
  interpret_definition!
  super
end

- (Object) unique_attribute_names



32
33
34
# File 'lib/thinking_sphinx/active_record/index.rb', line 32

def unique_attribute_names
  attributes.collect(&:name)
end