When updating OrderArticle: save ArticlePrice association

This commit is contained in:
Julius 2014-01-04 21:22:57 +01:00
parent e807ff8b38
commit 3c88f572a4

View file

@ -110,7 +110,7 @@ class OrderArticle < ActiveRecord::Base
# Updates also price attributes of article if update_current_price is selected # Updates also price attributes of article if update_current_price is selected
if update_current_price if update_current_price
article.update_attributes!(price_attributes) article.update_attributes!(price_attributes)
self.article_price = article.article_prices.first # Assign new created article price to order article self.article_price = article.article_prices.first and save # Assign new created article price to order article
else else
# Creates a new article_price if neccessary # Creates a new article_price if neccessary
# Set created_at timestamp to order ends, to make sure the current article price isn't changed # Set created_at timestamp to order ends, to make sure the current article price isn't changed