Fixed missing group_order_article in group_order show.

Also add eager loading for associated objects.
This commit is contained in:
benni 2012-12-16 16:50:09 +01:00
parent 0fcd5abb3a
commit 9919183cb0
4 changed files with 22 additions and 17 deletions

View file

@ -166,7 +166,7 @@ class GroupOrderArticle < ActiveRecord::Base
# Until the order is finished this will be the maximum price or
# the minimum price depending on configuration. When the order is finished it
# will be the value depending of the article results.
def total_price
def total_price(order_article = self.order_article)
unless order_article.order.finished?
if FoodsoftConfig[:tolerance_is_costly]
order_article.article.fc_price * (quantity + tolerance)