Class: ThinkingSphinx::Middlewares::ActiveRecordTranslator::Inner

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/middlewares/active_record_translator.rb

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Inner

Returns a new instance of Inner.



20
21
22
# File 'lib/thinking_sphinx/middlewares/active_record_translator.rb', line 20

def initialize(context)
  @context = context
end

Instance Method Details

#callObject



24
25
26
27
28
29
30
31
32
# File 'lib/thinking_sphinx/middlewares/active_record_translator.rb', line 24

def call
  results_for_models # load now to avoid segfaults

  context[:results] = if sql_options[:order]
    results_for_models.values.first
  else
    context[:results].collect { |row| result_for(row) }
  end
end