Index variants by id

This commit is contained in:
Rohan Mitchell
2015-06-04 12:09:34 +10:00
parent cf0031d9a5
commit 27bc28ffa4
2 changed files with 18 additions and 0 deletions

View File

@@ -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