Skip to content

Instantly share code, notes, and snippets.

@jseifer
Created September 24, 2015 15:29
Show Gist options
  • Save jseifer/cf3c58b6ac7fe831789f to your computer and use it in GitHub Desktop.
Save jseifer/cf3c58b6ac7fe831789f to your computer and use it in GitHub Desktop.
# An array of ids is returned for rake task output (see lib/tasks/doc_news.rake)
def self.process_queued_for_sample!(time: Time.now)
unprocessed.sample_sent_at_for(time).map do |digest|
if digest.can_sample?
digest.sample!
digest.id
end
end
end
# An array of ids is returned for rake task output (see lib/tasks/doc_news.rake)
def self.process_queued_for_final_delivery!(time: Time.now)
sampled.final_sent_at_for(time).map do |digest|
if digest.deliverable?
digest.deliver!
digest.id
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment