Skip to content

Instantly share code, notes, and snippets.

@duderman
Created August 31, 2015 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duderman/c1b466f33f6cebc07535 to your computer and use it in GitHub Desktop.
Save duderman/c1b466f33f6cebc07535 to your computer and use it in GitHub Desktop.
!!cus = CloudUnit.where(slug: 'images', created_at: dates).joins(:items).group('cloud_units.id').having('COUNT(cloud_items.*) <= 1').to_a
!!cus.each { |unit| Resque.enqueue(Jobs::CloudImageCreator, unit.id) if unit.needs_processing? }
!!Component.where(cloud_unit_id: cus.map(&:id)).each { |c| c.box.boxings.each { |bb| bb.boxable.roulette_me } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment