Skip to content

Commit

Permalink
Don't convert list of stock items to an array if all we need to do is…
Browse files Browse the repository at this point in the history
… sum
  • Loading branch information
radar committed Oct 8, 2013
1 parent 403b5d8 commit c096bc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/app/models/spree/stock/quantifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(variant)

def total_on_hand
if Spree::Config.track_inventory_levels
stock_items.to_a.sum(&:count_on_hand)
stock_items.sum(:count_on_hand)
else
Float::INFINITY
end
Expand Down

0 comments on commit c096bc3

Please sign in to comment.