Class: ThinkingSphinx::ActiveRecord::Callbacks::DeltaCallbacks
- Inherits:
-
Callbacks
- Object
- Callbacks
- ThinkingSphinx::ActiveRecord::Callbacks::DeltaCallbacks
show all
- Defined in:
- lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb
Instance Attribute Summary
Attributes inherited from Callbacks
#instance
Instance Method Summary
collapse
Methods inherited from Callbacks
callbacks, #initialize
Instance Method Details
#after_commit ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb', line 6
def after_commit
return unless delta_indices? && processors.any? { |processor|
processor.toggled?(instance)
} && !ThinkingSphinx::Deltas.suspended?
delta_indices.each do |index|
index.delta_processor.index index
end
core_indices.each do |index|
index.delta_processor.delete index, instance
end
end
|
#before_save ⇒ Object
20
21
22
23
24
|
# File 'lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb', line 20
def before_save
return unless delta_indices?
processors.each { |processor| processor.toggle instance }
end
|