rollups 0.4.0 → 0.4.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: b9e1a4c50bc160496a4bcc8f4709615dc7f030aa8ac69a02c2ff9ca7221adf94
4
- data.tar.gz: 271271318f3cc86e79b561fbc0e3ac32160a12cb0a72dfa47de71435a3114a3a
3
+ metadata.gz: 98d29255d1ec08a3ca9e7db462c8157b3c87056ffc2258c785bc768e87d1afaa
4
+ data.tar.gz: 1810ec099cb09c935de19a415e17bca8842f7d0a2cd5d1ecc5bbb5dc51c2b514
5
5
  SHA512:
6
- metadata.gz: 277e0ee40c5f156904547fa3ad92a9faaadeda7c7291426d29b2eb69f5187f80c60a57d83f9a430461a954c02150e3a8f1012a6348dfa8a88d082c5d6c8ffc5a
7
- data.tar.gz: 37b7ae3c133829ff04bbd06e04789ee94620b98ab3a1bc2c1f812da2cec44aeb2213631e8665c6d919735c8b856a5f548fc893e89874ec6da557e2710fac9f2a
6
+ metadata.gz: efdd0f38f818d3bef2cce27554b3b84e104b78f1844475b334273cbf81c3fbea0ebe7a2b37ae394eae9b429e4f7a687b6ee901ab286c6981aa5c177fec92a8f4
7
+ data.tar.gz: a6e0c406ccc598c3a070cf4819eef7d3cecb8ae761f825fe41580d21a95535f5c3c83c6b24569484be31865eba6dd36a0084c467a3f9324b5aa57b544040ad4c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.1 (2024-10-07)
2
+
3
+ - Fixed connection leasing for Active Record 7.2+
4
+
1
5
  ## 0.4.0 (2024-10-01)
2
6
 
3
7
  - Added support for Active Record 8
data/lib/rollup/utils.rb CHANGED
@@ -33,7 +33,7 @@ class Rollup
33
33
  end
34
34
 
35
35
  def adapter_name
36
- Rollup.connection.adapter_name
36
+ Rollup.connection_db_config.adapter.to_s
37
37
  end
38
38
 
39
39
  def postgresql?
@@ -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.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
data/lib/rollup.rb CHANGED
@@ -23,7 +23,7 @@ class Rollup < ActiveRecord::Base
23
23
 
24
24
  # use select_all due to incorrect casting with pluck
25
25
  sql = relation.order(:time).select(Utils.time_sql(interval), :value).to_sql
26
- result = connection.select_all(sql).rows
26
+ result = connection_pool.with_connection { |c| c.select_all(sql) }.rows
27
27
 
28
28
  Utils.make_series(result, interval)
29
29
  end
@@ -35,7 +35,7 @@ class Rollup < ActiveRecord::Base
35
35
 
36
36
  # use select_all to reduce allocations
37
37
  sql = relation.order(:time).select(Utils.time_sql(interval), :value, :dimensions).to_sql
38
- result = connection.select_all(sql).rows
38
+ result = connection_pool.with_connection { |c| c.select_all(sql) }.rows
39
39
 
40
40
  result.group_by { |r| JSON.parse(r[2]) }.map do |dimensions, rollups|
41
41
  {dimensions: dimensions, data: Utils.make_series(rollups, interval)}
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.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport