reparty 0.2.0 → 0.2.1

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.
data/History.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1
2
+
3
+ - Timezone fix (ActiveRecord always saves in UTC)
4
+
1
5
  ## 0.2.0
2
6
 
3
7
  - Much improved email template
@@ -36,9 +36,9 @@ module Reparty
36
36
 
37
37
  def daily_dataset
38
38
  if @operation == :total
39
- 7.downto(1).map { |x| @model.where("#{@field.to_s} < ?", DateTime.now.at_midnight-x).send(:count, @field) }
39
+ 7.downto(1).map { |x| @model.where("#{@field.to_s} < ?", DateTime.now.utc.at_midnight-x).send(:count, @field) }
40
40
  else
41
- 7.downto(1).map { |x| @model.where("DATE(#{@field.to_s}) = ?", DateTime.now.to_date-x).send(@operation, @field) }
41
+ 7.downto(1).map { |x| @model.where("DATE(#{@field.to_s}) = ?", DateTime.now.utc.to_date-x).send(@operation, @field) }
42
42
  end
43
43
  end
44
44
 
@@ -1,3 +1,3 @@
1
1
  module Reparty
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -32,7 +32,7 @@ describe Reparty::Report::ActiveRecord do
32
32
  end
33
33
  end
34
34
 
35
- its(:daily_dataset) { should == [1,1,1,1,1,0,2] }
35
+ its(:daily_dataset) { should == [1,1,1,1,0,2,0] }
36
36
  its(:yesterday) { should == 0 }
37
37
  its(:total) { should == 7 }
38
38
 
@@ -43,6 +43,6 @@ describe Reparty::Report::ActiveRecord do
43
43
  config.add_report Reparty::Report::ActiveRecord, "Users", User.where("score > 2")
44
44
  end
45
45
 
46
- Reparty.reports.first.daily_dataset.should == [1,1,0,1,1,0,2]
46
+ Reparty.reports.first.daily_dataset.should == [1,0,1,1,0,2,0]
47
47
  end
48
48
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: reparty
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tim Dorr
@@ -236,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
236
  - !ruby/object:Gem::Version
237
237
  segments:
238
238
  - 0
239
- hash: 3162642364766815676
239
+ hash: 1402825386359699857
240
240
  version: '0'
241
241
  none: false
242
242
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  - !ruby/object:Gem::Version
246
246
  segments:
247
247
  - 0
248
- hash: 3162642364766815676
248
+ hash: 1402825386359699857
249
249
  version: '0'
250
250
  none: false
251
251
  requirements: []