lib/chrono_model/patches/batches.rb in chrono_model-2.0.0 vs lib/chrono_model/patches/batches.rb in chrono_model-3.0.1
- old
+ new
@@ -1,17 +1,13 @@
# frozen_string_literal: true
module ChronoModel
module Patches
module Batches
- module BatchEnumerator
- def each(&block)
- if @relation.try(:history?)
- @relation.with_hid_pkey { super }
- else
- super
- end
- end
+ def in_batches(**)
+ return super unless try(:history?)
+
+ with_hid_pkey { super }
end
end
end
end