1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-17 11:54:22 +01:00

(bug) undefined method privileged? for nil:Class

This commit is contained in:
Sylvain 2022-09-27 09:43:21 +02:00
parent 040f74a2fe
commit e217f61524

View File

@ -111,7 +111,7 @@ class ProductService
end
def filter_by_stock(products, filters, operator)
return products if filters[:stock_type] == 'internal' && !operator.privileged?
return products if filters[:stock_type] == 'internal' && !operator&.privileged?
if filters[:stock_from].to_i.positive?
products = products.where('(stock ->> ?)::int >= ?', filters[:stock_type], filters[:stock_from])