Sha256: 3b62a7dfce8eb99eab7bcf29bfe167bdad7e719e97ff95921fea4338733ed2e9
Contents?: true
Size: 588 Bytes
Versions: 23
Compression:
Stored size: 588 Bytes
Contents
module Searchkick class ReindexJob def initialize(klass, id) @klass = klass @id = id end def perform model = @klass.constantize record = model.find(@id) rescue nil # TODO fix lazy coding index = model.searchkick_index if !record || !record.should_index? # hacky record ||= model.new record.id = @id begin index.remove record rescue Elasticsearch::Transport::Transport::Errors::NotFound # do nothing end else index.store record end end end end
Version data entries
23 entries across 23 versions & 2 rubygems