Be a bit more safe displaying stock ordergroup

This commit is contained in:
wvengen 2016-08-12 15:56:45 +02:00
parent d06a9ed3f0
commit 36706511c0

View file

@ -88,7 +88,7 @@ class GroupOrder < ActiveRecord::Base
end
def ordergroup_name
ordergroup ? ordergroup.name : I18n.t('model.group_order.stock_ordergroup_name', :user => updated_by.name)
ordergroup ? ordergroup.name : I18n.t('model.group_order.stock_ordergroup_name', :user => updated_by.try(:name) || '?')
end
end