Skip to content

Commit

Permalink
Call spree_orders, not orders in Spree::UserReporting
Browse files Browse the repository at this point in the history
Fixes #4644
  • Loading branch information
radar committed May 13, 2014
1 parent c76ac47 commit 3f44005
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/app/models/concerns/spree/user_reporting.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module Spree
module UserReporting
def lifetime_value
orders.complete.pluck(:total).sum
spree_orders.complete.pluck(:total).sum
end

def display_lifetime_value
Spree::Money.new(lifetime_value)
end

def order_count
BigDecimal(orders.complete.count)
BigDecimal(spree_orders.complete.count)
end

def average_order_value
Expand Down
2 changes: 1 addition & 1 deletion core/spec/models/spree/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
end

def load_orders
subject.stub(:orders).and_return(double(complete: orders))
subject.stub(:spree_orders).and_return(double(complete: orders))
end

describe "#lifetime_value" do
Expand Down

0 comments on commit 3f44005

Please sign in to comment.