mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-30 06:31:16 +00:00
Index variants by id
This commit is contained in:
@@ -46,6 +46,13 @@ Spree::Variant.class_eval do
|
||||
}
|
||||
|
||||
|
||||
def self.indexed
|
||||
Hash[
|
||||
scoped.map { |v| [v.id, v] }
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
def price_with_fees(distributor, order_cycle)
|
||||
price + fees_for(distributor, order_cycle)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user