rollups 0.3.0 → 0.3.2

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: 13842cdbcce3b4b43bd7d8aeb91f1e7af030cdf17d3e030f1bfe8d30eadc3bf4
4
- data.tar.gz: e86af13b7e72c7e236d341b5b46158389ae4c8f7425b1580d94b8969e22656c0
3
+ metadata.gz: 0e5c6fead572e785077c4ab0afd4e627dd152580a5f7d06dfaec55cca368892f
4
+ data.tar.gz: c48a223298b96a5404fda29192f6453e92f6f00fe10b53db5dfc633fe46696c8
5
5
  SHA512:
6
- metadata.gz: 6c8a4add9c0e04504260e64db82573d131dd666f97ff5c7e6b9ea7dc6b28cf24a70c03e5b6ba67eb01539d66cf0ae915c76c1cfc69f7cbe7b56d78fc49f871dc
7
- data.tar.gz: 582ed4c461e377e3fc1afa38f03c6c2cfcb0e4d08bfa0aa3b959cf8488731edc36d7371ee2a1ac5ba9ab63cdec90fb65ccc78283b6571ccd3124f472aad27244
6
+ metadata.gz: d831822c3b6c4b70d119a2bcd704ae579d8f444cf7ffce388842aa5fc7841d0435669a203b9c54a55629088dfb553ead3288a6282d9f4ea5d5b9b9f737222086
7
+ data.tar.gz: af477019c11b0a75548d4181e7cf693d75487565ab99dd4b469bc3d748902d0cb802f2f868509cc71eb914e37796a435b013bbcc42a82a3189f9be0779b43c19
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.3.2 (2024-02-09)
2
+
3
+ - Fixed incorrect rollups with `time_zone: false` when `Rollup.time_zone` has a negative UTC offset
4
+
5
+ ## 0.3.1 (2023-09-20)
6
+
7
+ - Added support for Trilogy
8
+
1
9
  ## 0.3.0 (2023-07-02)
2
10
 
3
11
  - Dropped support for Ruby < 3 and Active Record < 6.1
@@ -43,7 +43,7 @@ class Rollup
43
43
  raise ArgumentError, "Cannot use range and current together" if range && !current.nil?
44
44
 
45
45
  current = true if current.nil?
46
- time_zone ||= Rollup.time_zone
46
+ time_zone = Rollup.time_zone if time_zone.nil?
47
47
 
48
48
  gd_options = {
49
49
  current: current
@@ -68,7 +68,14 @@ class Rollup
68
68
  # for MySQL on Ubuntu 18.04 (and likely other platforms)
69
69
  if max_time.is_a?(String)
70
70
  utc = ActiveSupport::TimeZone["Etc/UTC"]
71
- max_time = Utils.date_interval?(interval) ? max_time.to_date : utc.parse(max_time).in_time_zone(time_zone)
71
+ max_time =
72
+ if Utils.date_interval?(interval)
73
+ max_time.to_date
74
+ else
75
+ t = utc.parse(max_time)
76
+ t = t.in_time_zone(time_zone) if time_zone
77
+ t
78
+ end
72
79
  end
73
80
 
74
81
  # aligns perfectly if time zone doesn't change
data/lib/rollup/utils.rb CHANGED
@@ -41,7 +41,7 @@ class Rollup
41
41
  end
42
42
 
43
43
  def mysql?
44
- adapter_name =~ /mysql/i
44
+ adapter_name =~ /mysql|trilogy/i
45
45
  end
46
46
 
47
47
  def sqlite?
@@ -1,5 +1,5 @@
1
1
  class Rollup
2
2
  # not used in gemspec to avoid superclass mismatch
3
3
  # be sure to update there as well
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-02 00:00:00.000000000 Z
11
+ date: 2024-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.4.10
78
+ rubygems_version: 3.5.3
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Rollup time-series data in Rails