Use OrderArticle#create in receive form instead of Order#add_article
This commit is contained in:
parent
59c118a171
commit
033aa90698
6 changed files with 36 additions and 55 deletions
|
|
@ -16,7 +16,7 @@ class OrderArticlesController < ApplicationController
|
|||
# given mentioning that the article already exists, which is desired.
|
||||
@order_article = @order.order_articles.where(:article_id => params[:order_article][:article_id]).first
|
||||
if @order_article and @order_article.units_to_order == 0
|
||||
@order_article.units_to_order = 1
|
||||
@order_article.units_to_order = 1 # FIXME: this is ugly if used in the receive form
|
||||
else
|
||||
@order_article = OrderArticle.new(params[:order_article])
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue