Class: ThinkingSphinx::Middlewares::ActiveRecordTranslator::Inner
- Inherits:
-
Object
- Object
- ThinkingSphinx::Middlewares::ActiveRecordTranslator::Inner
- Defined in:
- lib/thinking_sphinx/middlewares/active_record_translator.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(context) ⇒ Inner
constructor
A new instance of Inner.
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
#call ⇒ Object
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 [:order] results_for_models.values.first else context[:results].collect { |row| result_for(row) } end end |