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

@ -20,7 +20,7 @@ class GroupOrderArticlesController < ApplicationController
goa = GroupOrderArticle.where(group_order_id: @group_order_article.group_order_id,
order_article_id: @order_article.id).first
if goa and goa.update_attributes(params[:group_order_article])
if goa && goa.update_attributes(params[:group_order_article])
@group_order_article = goa
update_summaries(@group_order_article)
@ -50,7 +50,7 @@ class GroupOrderArticlesController < ApplicationController
def destroy
# only destroy if quantity and tolerance was zero already, so that we don't
# lose what the user ordered, if any
if @group_order_article.quantity > 0 or @group_order_article.tolerance >0
if @group_order_article.quantity > 0 || @group_order_article.tolerance >0
@group_order_article.update_attribute(:result, 0)
else
@group_order_article.destroy