Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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