styling fixes and fix for supplier deleted products...
This commit is contained in:
@@ -10,4 +10,9 @@ class ProductOrder
|
||||
view :by_product_id, key: :product_id
|
||||
view :by_order_id, key: :order_id
|
||||
|
||||
# Getter for product name. If a supplier deletes a product, that has product_orders, the product
|
||||
# will become nil. This method should handle this case.
|
||||
def product_name
|
||||
product.try(:name) || '[deleted]'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user