Commit 50bed223f620b6c0b86101bfe2ea81be5c0aacdf
Committed by
Antonio Terceiro
1 parent
272250bf
Exists in
master
and in
28 other branches
fixing migration bug on manage products
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
UPGRADE
| @@ -43,3 +43,7 @@ I changed the tests | @@ -43,3 +43,7 @@ I changed the tests | ||
| 43 | to make the test usefull | 43 | to make the test usefull |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | +6 - I changed the way as the product is created on ManageProducts controller. I removed the line: | ||
| 47 | + @product.build_image unless @product.image | ||
| 48 | + | ||
| 49 | +because the image was never saved. It don't have valid values to be saved. |
app/controllers/my_profile/manage_products_controller.rb
| @@ -26,7 +26,6 @@ class ManageProductsController < ApplicationController | @@ -26,7 +26,6 @@ class ManageProductsController < ApplicationController | ||
| 26 | @object = Product.new | 26 | @object = Product.new |
| 27 | @categories = @current_category.nil? ? ProductCategory.top_level_for(environment) : @current_category.children | 27 | @categories = @current_category.nil? ? ProductCategory.top_level_for(environment) : @current_category.children |
| 28 | @product = @profile.products.build(params[:product]) | 28 | @product = @profile.products.build(params[:product]) |
| 29 | - @product.build_image unless @product.image | ||
| 30 | if request.post? | 29 | if request.post? |
| 31 | if @product.save | 30 | if @product.save |
| 32 | flash[:notice] = _('Product succesfully created') | 31 | flash[:notice] = _('Product succesfully created') |