Clean up OrderArticle#new form and related stuff

This commit is contained in:
Julius 2013-12-31 12:27:10 +01:00 committed by wvengen
parent baa5f16cfc
commit 01264bc0ac
7 changed files with 13 additions and 6 deletions

View file

@ -199,7 +199,9 @@ class OrderArticle < ActiveRecord::Base
private
def article_and_price_exist
errors.add(:article, I18n.t('model.order_article.error_price')) if !(article = Article.find(article_id)) || article.fc_price.nil?
errors.add(:article, I18n.t('model.order_article.error_price')) if !(article = Article.find(article_id)) || article.fc_price.nil?
rescue
errors.add(:article, I18n.t('model.order_article.error_price'))
end
# Associate with current article price if created in a finished order