From 50bed223f620b6c0b86101bfe2ea81be5c0aacdf Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Sun, 21 Jun 2009 21:17:04 -0300 Subject: [PATCH] fixing migration bug on manage products --- UPGRADE | 4 ++++ app/controllers/my_profile/manage_products_controller.rb | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/UPGRADE b/UPGRADE index f1bc767..5149eab 100644 --- a/UPGRADE +++ b/UPGRADE @@ -43,3 +43,7 @@ I changed the tests to make the test usefull +6 - I changed the way as the product is created on ManageProducts controller. I removed the line: + @product.build_image unless @product.image + +because the image was never saved. It don't have valid values to be saved. diff --git a/app/controllers/my_profile/manage_products_controller.rb b/app/controllers/my_profile/manage_products_controller.rb index 32938d1..8671569 100644 --- a/app/controllers/my_profile/manage_products_controller.rb +++ b/app/controllers/my_profile/manage_products_controller.rb @@ -26,7 +26,6 @@ class ManageProductsController < ApplicationController @object = Product.new @categories = @current_category.nil? ? ProductCategory.top_level_for(environment) : @current_category.children @product = @profile.products.build(params[:product]) - @product.build_image unless @product.image if request.post? if @product.save flash[:notice] = _('Product succesfully created') -- libgit2 0.21.2