groupdate 6.0.0 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0169fac01ba6b7b7a051ae37d2cc3d5b89b137b7bb3d609df7a633b534ac89b
4
- data.tar.gz: ccdf270ed3726d0c0a52e9fafe0fb3b2281f6b31ac0a9a731eaedfbda8f42067
3
+ metadata.gz: 12cfc48ae509ac20872022dd07429dd7bd8f24a5bfd81dcb16242f3519cb5385
4
+ data.tar.gz: 3079f700f956f141184fbc5bc8244ad90380804cea9f15fef51300985380d13e
5
5
  SHA512:
6
- metadata.gz: aa3150d5c5edd803e225045d745faf191fef78f483fec13aac05f4fb7dc0ee04a1b7a9340f1f8cf35a8d1c79ed09a6e6e6c4432e094d54faf5c7af48385c5e68
7
- data.tar.gz: 97137d089ec745cdbcf08d1c7999f3efefab9c8cb3dd39e4e033f28184b8e4d4955cb4f7777cd7e8f8d28a3dda8b3dce2826242322de1949c2f72ad11f24a32d
6
+ metadata.gz: 64b4e317731bc0032a914e4f07ca751ee276e41b7a30a2113bff9d9f2437196916c68e5f1f699c2e107861d0022b712b32315132cd0f530bb7caad5f41955e45
7
+ data.tar.gz: ea085f2e6985f4df40f591333935b88f8c59b2be87943f39241254dbbc8ac18cc1aaa2b54030880a804117ecdc0451a65463b07ea758d3fc93d99697a11a5711
data/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
+ ## 6.0.1 (2022-01-16)
2
+
3
+ - Fixed incorrect results (error before 6.0) with `includes` with Active Record 6.1+
4
+
1
5
  ## 6.0.0 (2022-01-15)
2
6
 
3
- - Changed SQL to return dates instead of times for day, week, month, quarter, and year
4
- - Added `n` option for Redshift
5
- - Removed `dates` option
6
7
  - Raise `ActiveRecord::UnknownAttributeReference` for non-attribute arguments
7
8
  - Raise `ArgumentError` for ranges with string bounds
9
+ - Added `n` option for Redshift
10
+ - Changed SQL to return dates instead of times for day, week, month, quarter, and year
11
+ - Removed `dates` option
8
12
  - Dropped support for Ruby < 2.6 and Rails < 5.2
9
13
 
10
14
  ## 5.2.4 (2021-12-15)
@@ -146,6 +146,7 @@ module Groupdate
146
146
  when :day_of_week
147
147
  lambda { |k| (k.to_i - 1 - week_start) % 7 }
148
148
  when :day, :week, :month, :quarter, :year
149
+ # TODO keep as date
149
150
  if day_start != 0
150
151
  day_start_hour = day_start / 3600
151
152
  day_start_min = (day_start % 3600) / 60
@@ -9,6 +9,9 @@ module Groupdate
9
9
  end
10
10
 
11
11
  def calculate(*args, &block)
12
+ # prevent calculate from being called twice
13
+ return super if ActiveRecord::VERSION::STRING.to_f >= 6.1 && has_include?(args[1])
14
+
12
15
  default_value = [:count, :sum].include?(args[0]) ? 0 : nil
13
16
  Groupdate.process_result(self, super, default_value: default_value)
14
17
  end
@@ -1,3 +1,3 @@
1
1
  module Groupdate
2
- VERSION = "6.0.0"
2
+ VERSION = "6.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdate
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.3.3
68
+ rubygems_version: 3.2.32
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: The simplest way to group temporal data