Created
February 20, 2012 02:11
-
-
Save mattfitzgerald/1867256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find messages triggered as self generating delayed jobs that have no job and setup | |
AnniversaryMessage.find_all_by_enabled(true).select{|am| AnniversaryMessageSchedulerDelayedAction.currently_enqueued_for(am).empty?}.each{|m| m.setup_delayed_job} | |
BirthdayMessage.find_all_by_enabled(true).select{|bm| BirthdayMessageSchedulerDelayedAction.currently_enqueued_for(bm).empty?}.each{|m| m.setup_delayed_job} | |
AnnualPlannerMessage.find_all_by_enabled(true).select{|apm| AnniversaryMessageSchedulerDelayedAction.currently_enqueued_for(apm).empty?}.each{|m| m.setup_delayed_job} | |
OngoingCampaign.find_all_by_enabled(true).select{|om| OngoingMessageSchedulerDelayedAction.currently_enqueued_for(om).empty?}.each{|m| m.setup_delayed_job} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment