Commit 64fbf6e50cc3ead8b6a0dc49ddc69fe64abf0207

Authored by Andrew Kane
1 parent cff0e646

Prevent exists? check if records is a relation [skip ci]

Showing 1 changed file with 2 additions and 0 deletions   Show diff stats
lib/searchkick/record_indexer.rb
@@ -7,6 +7,8 @@ module Searchkick @@ -7,6 +7,8 @@ module Searchkick
7 end 7 end
8 8
9 def reindex(records, mode:, method_name:, full: false, single: false) 9 def reindex(records, mode:, method_name:, full: false, single: false)
  10 + # prevents exists? check if records is a relation
  11 + records = records.to_a
10 return if records.empty? 12 return if records.empty?
11 13
12 case mode 14 case mode