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 +4 -4
- data/CHANGELOG.md +7 -3
- data/lib/groupdate/magic.rb +1 -0
- data/lib/groupdate/relation.rb +3 -0
- data/lib/groupdate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cfc48ae509ac20872022dd07429dd7bd8f24a5bfd81dcb16242f3519cb5385
|
4
|
+
data.tar.gz: 3079f700f956f141184fbc5bc8244ad90380804cea9f15fef51300985380d13e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/groupdate/magic.rb
CHANGED
@@ -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
|
data/lib/groupdate/relation.rb
CHANGED
@@ -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
|
data/lib/groupdate/version.rb
CHANGED
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.
|
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.
|
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
|