Commit 3c1f2ef3

mo k <mo@mokhan.ca>
2012-10-11 13:16:58
start a background process for the images after the creation saves successfully.
1 parent f37a303
Changed files (1)
app/controllers/creations_controller.rb
@@ -25,8 +25,8 @@ class CreationsController < ApplicationController
   def create
     @creation = current_user.creations.create(params[:creation])
     @creation.category_ids = params[:creation][:category_ids] ||= []
-    @creation.delay.migrate_primary_image
     if @creation.save
+      @creation.delay.migrate_primary_image
       redirect_to(creations_url, :notice => 'Thank you for sharing your creation.') 
     else
       flash[:error] = @creation.errors.full_messages