Sha256: ae1fe6f5de2237cd065ec13825c2ffcb865b24c0ed8e5aeef0673de2db44b78a

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

class ThinkingSphinx::ActiveRecord::Callbacks::DeleteCallbacks <
  ThinkingSphinx::Callbacks

  callbacks :after_destroy

  def after_destroy
    return if instance.new_record?

    indices.each { |index|
      ThinkingSphinx::Deletion.perform index, instance.id
    }
  end

  private

  def indices
    ThinkingSphinx::Configuration.instance.index_set_class.new(
      :classes => [instance.class]
    ).to_a
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thinking-sphinx-3.1.4 lib/thinking_sphinx/active_record/callbacks/delete_callbacks.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/active_record/callbacks/delete_callbacks.rb