Issue 231: doesn't set rank for new images
Status:  New
Owner: ----
Reported by freeldss...@gmail.com, Mar 14, 2014
What steps will reproduce the problem?
1. upload an image
2. detect the newly uploaded image's product_image rank -- it's nil

Mar 14, 2014
#1 rogerpack2005
diff --git a/app/controllers/admin/products_controller.rb b/app/controllers/admin/products_controller.rb
index 0bcd19b..962ea23 100644
--- a/app/controllers/admin/products_controller.rb
+++ b/app/controllers/admin/products_controller.rb
@@ -264,6 +264,9 @@ class Admin::ProductsController < Admin::BaseController
             new_image.uploaded_data = i[:image_data]
             if new_image.save
               @product.images << new_image
+              product_image = new_image.reload.product_images[0]
+              product_image.rank = @product.reload.next_image_rank_to_use 
+              product_image.save
             else
               image_errors.push(new_image.filename + " " +  new_image.errors.map{|e| e.to_s}.join(' '))
             end

perhaps? (see other patches on the ML FWIW) :)