Use more boolean comparators where it makes sense
This commit is contained in:
parent
1063aea4af
commit
7e0aa66936
8 changed files with 15 additions and 15 deletions
|
|
@ -15,7 +15,7 @@ class OrderArticlesController < ApplicationController
|
|||
# If order_article is ordered and a new order_article is created, an error message will be
|
||||
# given mentioning that the article already exists, which is desired.
|
||||
@order_article = @order.order_articles.where(:article_id => params[:order_article][:article_id]).first
|
||||
unless (@order_article and @order_article.units_to_order == 0)
|
||||
unless @order_article && @order_article.units_to_order == 0
|
||||
@order_article = @order.order_articles.build(params[:order_article])
|
||||
end
|
||||
@order_article.save!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue