Class: ThinkingSphinx::RealTime::Callbacks::RealTimeCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/real_time/callbacks/real_time_callbacks.rb

Instance Method Summary collapse

Constructor Details

#initialize(reference, path = []) ⇒ RealTimeCallbacks

Returns a new instance of RealTimeCallbacks



2
3
4
# File 'lib/thinking_sphinx/real_time/callbacks/real_time_callbacks.rb', line 2

def initialize(reference, path = [])
  @reference, @path = reference, path
end

Instance Method Details

#after_save(instance) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/thinking_sphinx/real_time/callbacks/real_time_callbacks.rb', line 6

def after_save(instance)
  return unless real_time_indices?

  real_time_indices.each do |index|
    objects_for(instance).each do |object|
      ThinkingSphinx::RealTime::Transcriber.new(index).copy object
    end
  end
end