Use more boolean comparators where it makes sense

This commit is contained in:
wvengen 2015-01-14 22:56:32 +01:00
parent 1063aea4af
commit 7e0aa66936
8 changed files with 15 additions and 15 deletions

View file

@ -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!