Skip to content

Commit

Permalink
Use to_a
Browse files Browse the repository at this point in the history
  • Loading branch information
cdccollins committed Dec 10, 2024
1 parent e7c8563 commit 6aa4045
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/tasks/scheduler.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace :scheduler do
(next unless Date.today.wday == ENV.fetch("WEEKLY_MESSAGE_DAY").to_i) if ENV.fetch("SET_WEEKLY") == "true"

User.contactable.wants_morning_message.find_in_batches do |users|
SendBulkMessageJob.perform_later(users)
SendBulkMessageJob.perform_later(users.to_a)
end
end

Expand All @@ -13,7 +13,7 @@ namespace :scheduler do
(next unless Date.today.wday == ENV.fetch("WEEKLY_MESSAGE_DAY").to_i) if ENV.fetch("SET_WEEKLY") == "true"

User.contactable.wants_afternoon_message.find_in_batches do |users|
SendBulkMessageJob.perform_later(users)
SendBulkMessageJob.perform_later(users.to_a)
end
end

Expand All @@ -22,7 +22,7 @@ namespace :scheduler do
(next unless Date.today.wday == ENV.fetch("WEEKLY_MESSAGE_DAY").to_i) if ENV.fetch("SET_WEEKLY") == "true"

User.contactable.wants_evening_message.find_in_batches do |users|
SendBulkMessageJob.perform_later(users)
SendBulkMessageJob.perform_later(users.to_a)
end
end

Expand All @@ -31,7 +31,7 @@ namespace :scheduler do
(next unless Date.today.wday == ENV.fetch("WEEKLY_MESSAGE_DAY").to_i) if ENV.fetch("SET_WEEKLY") == "true"

User.contactable.no_preference_message.find_in_batches do |users|
SendBulkMessageJob.perform_later(users)
SendBulkMessageJob.perform_later(users.to_a)
end
end

Expand Down

0 comments on commit 6aa4045

Please sign in to comment.