Module: Sunspot::Rails::RequestLifecycle

Defined in:
lib/sunspot/rails/request_lifecycle.rb

Overview

This module adds an after_filter to ActionController::Base that commits the Sunspot session if any documents have been added, changed, or removed in the course of the request.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



10
11
12
13
14
# File 'lib/sunspot/rails/request_lifecycle.rb', line 10

def included(base) #:nodoc:
  base.after_filter do
    Sunspot.commit_if_dirty if Sunspot::Rails.configuration.auto_commit_after_request?
  end
end