spree_dash 0.30.2 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,12 +70,12 @@ class Admin::OverviewController < Admin::BaseController
70
70
  def orders_by_day(params)
71
71
 
72
72
  if params[:value] == "Count"
73
- orders = Order.find(:all, :select => 'created_at', :conditions => conditions(params))
73
+ orders = Order.select(:created_at).where(conditions(params))
74
74
  orders = orders.group_by { |o| o.created_at.to_date }
75
75
  fill_empty_entries(orders, params)
76
76
  orders.keys.sort.map {|key| [key.strftime('%Y-%m-%d'), orders[key].size ]}
77
77
  else
78
- orders = Order.find(:all, :select => 'total, created_at', :conditions => conditions(params))
78
+ orders = Order.select([:created_at, :total]).where(conditions(params))
79
79
  orders = orders.group_by { |o| o.created_at.to_date }
80
80
  fill_empty_entries(orders, params)
81
81
  orders.keys.sort.map {|key| [key.strftime('%Y-%m-%d'), orders[key].inject(0){|s,o| s += o.total} ]}
@@ -126,7 +126,7 @@ class Admin::OverviewController < Admin::BaseController
126
126
  end
127
127
 
128
128
  def last_five_orders
129
- orders = Order.find(:all, :order => "completed_at DESC", :limit => 5, :include => :line_items, :conditions => "completed_at is not null")
129
+ orders = Order.includes(:line_items).where("completed_at IS NOT NULL").order("completed_at DESC").limit(5)
130
130
  orders.map do |o|
131
131
  qty = o.line_items.inject(0) {|sum,li| sum + li.quantity}
132
132
 
@@ -148,6 +148,6 @@ class Admin::OverviewController < Admin::BaseController
148
148
  end
149
149
 
150
150
  def out_of_stock_products
151
- Product.find(:all, :conditions => {:count_on_hand => 0}, :limit => 5)
151
+ Product.where(:count_on_hand => 0).limit(5)
152
152
  end
153
153
  end
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: 99
5
- prerelease:
4
+ hash: 191
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 30
9
- - 2
10
- version: 0.30.2
8
+ - 40
9
+ - 0
10
+ version: 0.40.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Quinn
@@ -15,7 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-23 00:00:00 Z
18
+ date: 2010-12-22 00:00:00 -05:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: spree_core
@@ -25,12 +26,12 @@ dependencies:
25
26
  requirements:
26
27
  - - "="
27
28
  - !ruby/object:Gem::Version
28
- hash: 99
29
+ hash: 191
29
30
  segments:
30
31
  - 0
31
- - 30
32
- - 2
33
- version: 0.30.2
32
+ - 40
33
+ - 0
34
+ version: 0.40.0
34
35
  type: :runtime
35
36
  version_requirements: *id001
36
37
  description: Required dependancy for Spree
@@ -60,6 +61,7 @@ files:
60
61
  - public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js
61
62
  - public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js
62
63
  - public/stylesheets/admin/dashboard.css
64
+ has_rdoc: true
63
65
  homepage: http://spreecommerce.com
64
66
  licenses: []
65
67
 
@@ -91,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
93
  requirements:
92
94
  - none
93
95
  rubyforge_project: spree_dash
94
- rubygems_version: 1.8.10
96
+ rubygems_version: 1.3.7
95
97
  signing_key:
96
98
  specification_version: 3
97
99
  summary: Overview dashboard for use with Spree.