From 5ad58d990c0fba6fea84c2d4adf663b92381b8df Mon Sep 17 00:00:00 2001 From: Michael Harrison Date: Wed, 25 Oct 2023 15:47:53 -0500 Subject: [PATCH] add .to_a to SF query --- lib/tasks/accounts/update_adopter_status.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/accounts/update_adopter_status.rake b/lib/tasks/accounts/update_adopter_status.rake index e1f1e5ac3..b1e061151 100644 --- a/lib/tasks/accounts/update_adopter_status.rake +++ b/lib/tasks/accounts/update_adopter_status.rake @@ -3,7 +3,7 @@ namespace :accounts do # rake accounts:update_adopter_status task update_adopter_status: [:environment] do loop do - users = User.where(adopter_status: nil).where.not(salesforce_contact_id: nil ).limit(250) + users = User.where(adopter_status: nil).where.not(salesforce_contact_id: nil).limit(250) contacts = OpenStax::Salesforce::Remote::Contact.select( :id, @@ -11,6 +11,7 @@ namespace :accounts do :accounts_uuid ) .where(id: users.map(&:salesforce_contact_id)) + .to_a .index_by(&:id) updated_users = users.map do |user|