Class: ThinkingSphinx::ActiveRecord::SQLSource::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/sql_source/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Template

Returns a new instance of Template.



6
7
8
# File 'lib/thinking_sphinx/active_record/sql_source/template.rb', line 6

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



4
5
6
# File 'lib/thinking_sphinx/active_record/sql_source/template.rb', line 4

def source
  @source
end

Instance Method Details

#applyObject



10
11
12
13
14
15
16
# File 'lib/thinking_sphinx/active_record/sql_source/template.rb', line 10

def apply
  add_field class_column, :sphinx_internal_class_name

  add_attribute primary_key,  :sphinx_internal_id,    nil
  add_attribute class_column, :sphinx_internal_class, :string, :facet => true
  add_attribute '0',          :sphinx_deleted,        :integer
end