Skip to content

Commit

Permalink
add .to_a to SF query
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Oct 25, 2023
1 parent 8d9ec39 commit 5ad58d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tasks/accounts/update_adopter_status.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ 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,
:adoption_status,
:accounts_uuid
)
.where(id: users.map(&:salesforce_contact_id))
.to_a
.index_by(&:id)

updated_users = users.map do |user|
Expand Down

0 comments on commit 5ad58d9

Please sign in to comment.