Skip to content

Instantly share code, notes, and snippets.

@tonatiuh
Created March 12, 2013 19:40
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 tonatiuh/5146283 to your computer and use it in GitHub Desktop.
Save tonatiuh/5146283 to your computer and use it in GitHub Desktop.
require 'delayed_job'
namespace :content do
desc "Generates the bouquet template images"
task :generate_bouquet_template_images => :environment do
puts ">>>>>>>>>>>>>>>>>>>>>> Creating (or recreating) the bouquet template image versions"
handle_asynchronously :recreate_bouquet_template_main_images
end
def recreate_bouquet_template_main_images
BouquetImage.all.each do |bouquet_image|
if bouquet_image.image_type == "main"
bouquet_image.image.recreate_versions!
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment