do not error when calling shared_article on non-shared article

This commit is contained in:
wvengen 2013-11-13 23:20:48 +01:00
parent ac6b00d4f5
commit 588898d7b0

View file

@ -106,7 +106,7 @@ class Article < ActiveRecord::Base
# to get the correspondent shared article # to get the correspondent shared article
def shared_article def shared_article
@shared_article ||= self.supplier.shared_supplier.shared_articles.find_by_number(self.order_number) @shared_article ||= self.supplier.shared_supplier.shared_articles.find_by_number(self.order_number) rescue nil
end end
# convert units in foodcoop-size # convert units in foodcoop-size