do not error when calling shared_article on non-shared article
This commit is contained in:
parent
ac6b00d4f5
commit
588898d7b0
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue