Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3cdf33c

Browse files
committedNov 10, 2024··
Fix UpdateInBatches with string
1 parent 9ad58b3 commit 3cdf33c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/update_in_batches.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module UpdateInBatches
44
# rubocop:disable all
55
refine ActiveRecord::Relation do
66
def update_in_batches(updates = {}, of: 10000, **kwargs)
7-
updates = updates.merge(kwargs)
7+
updates = updates.merge(kwargs) if updates.is_a?(Hash)
88
relation = self
99
relation = relation.reorder(batch_order).limit(of)
1010
batch_relation = relation

0 commit comments

Comments
 (0)
Please sign in to comment.