Sha256: 5a52d5a70af8672da2e01c80fadb8a3eea95a395cc3a12b41e678d67fb4c2ff1
Contents?: true
Size: 1.07 KB
Versions: 10
Compression:
Stored size: 1.07 KB
Contents
module ThinkingSphinx::Deltas def self.config ThinkingSphinx::Configuration.instance end def self.processor_for(delta) case delta when TrueClass ThinkingSphinx::Deltas::DefaultDelta when Class delta when String delta.constantize else nil end end def self.resume! @suspended = false end def self.suspend(reference, &block) suspend! yield resume! config.indices_for_references(reference).each do |index| index.delta_processor.index index if index.delta? end end def self.suspend_and_update(reference, &block) suspend reference, &block ids = reference.to_s.camelize.constantize.where(delta: true).pluck(:id) config.indices_for_references(reference).each do |index| ThinkingSphinx::Deletion.perform index, ids unless index.delta? end end def self.suspend! @suspended = true end def self.suspended? @suspended end end require 'thinking_sphinx/deltas/default_delta' require 'thinking_sphinx/deltas/delete_job' require 'thinking_sphinx/deltas/index_job'
Version data entries
10 entries across 10 versions & 1 rubygems