From 96d423ad4ba8dc58543d86ca0f61a3504f43cae4 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 15 Jan 2017 05:01:54 -0800 Subject: [PATCH] Get unique record ids for conversions in readme example [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45600af..1125526 100644 --- a/README.md +++ b/README.md @@ -1185,7 +1185,7 @@ class ReindexConversionsJob < ActiveJob::Base def perform(class_name) recently_converted_ids = Searchjoy::Search.where("convertable_type = ? AND converted_at > ?", class_name, 1.day.ago) - .pluck(:convertable_id).sort + .order(:convertable_id).uniq.pluck(:convertable_id) recently_converted_ids.in_groups_of(1000, false) do |ids| # fetch conversions and group by record -- libgit2 0.21.0