spree_dash 0.60.1 → 0.60.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -99,7 +99,7 @@ class Admin::OverviewController < Admin::BaseController
99
99
  end
100
100
 
101
101
  def best_selling_variants
102
- li = LineItem.sum(:quantity, :group => :variant_id, :limit => 5)
102
+ li = LineItem.includes(:order).where("orders.state = 'complete'").sum(:quantity, :group => :variant_id, :limit => 5)
103
103
  variants = li.map do |v|
104
104
  variant = Variant.find(v[0])
105
105
  [variant.name, v[1] ]
@@ -108,8 +108,8 @@ class Admin::OverviewController < Admin::BaseController
108
108
  end
109
109
 
110
110
  def top_grossing_variants
111
- quantity = LineItem.sum(:quantity, :group => :variant_id, :limit => 5)
112
- prices = LineItem.sum(:price, :group => :variant_id, :limit => 5)
111
+ quantity = LineItem.includes(:order).where("orders.state = 'complete'").sum(:quantity, :group => :variant_id, :limit => 5)
112
+ prices = LineItem.includes(:order).where("orders.state = 'complete'").sum(:price, :group => :variant_id, :limit => 5)
113
113
  variants = quantity.map do |v|
114
114
  variant = Variant.find(v[0])
115
115
  [variant.name, v[1] * prices[v[0]]]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_dash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 237
4
+ hash: 235
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 60
9
- - 1
10
- version: 0.60.1
9
+ - 2
10
+ version: 0.60.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Quinn
@@ -15,25 +15,24 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-21 00:00:00 -04:00
19
- default_executable:
18
+ date: 2011-10-05 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
26
24
  - - "="
27
25
  - !ruby/object:Gem::Version
28
- hash: 237
26
+ hash: 235
29
27
  segments:
30
28
  - 0
31
29
  - 60
32
- - 1
33
- version: 0.60.1
34
- version_requirements: *id001
35
- name: spree_core
30
+ - 2
31
+ version: 0.60.2
32
+ requirement: *id001
33
+ type: :runtime
36
34
  prerelease: false
35
+ name: spree_core
37
36
  description: Required dependancy for Spree
38
37
  email: brian@railsdog.com
39
38
  executables: []
@@ -61,7 +60,6 @@ files:
61
60
  - public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js
62
61
  - public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js
63
62
  - public/stylesheets/admin/dashboard.css
64
- has_rdoc: true
65
63
  homepage: http://spreecommerce.com
66
64
  licenses: []
67
65
 
@@ -93,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
91
  requirements:
94
92
  - none
95
93
  rubyforge_project: spree_dash
96
- rubygems_version: 1.6.2
94
+ rubygems_version: 1.8.10
97
95
  signing_key:
98
96
  specification_version: 3
99
97
  summary: Overview dashboard for use with Spree.