Commit f27f0b623296ec790fc2ff7f77e74adb1946697a

Authored by Rustam Sharshenov
1 parent 812b38b1

Do not try to import empty records array

Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
lib/searchkick/logging.rb
... ... @@ -38,6 +38,7 @@ module Searchkick
38 38 alias_method_chain :remove, :instrumentation
39 39  
40 40 def import_with_instrumentation(records)
  41 + return unless records.any?
41 42 event = {
42 43 name: "#{records.first.searchkick_klass.name} Import",
43 44 count: records.size
... ...