rollups 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/lib/rollup/aggregator.rb +4 -4
- data/lib/rollup/version.rb +1 -1
- data/lib/rollups.rb +1 -0
- metadata +4 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 436de838dcb69b97a2e4be818c0b512b6e59b843da66f74d3d58f78b1930d487
|
4
|
+
data.tar.gz: a3b91b96b19d804fce867f6faa1f72e031840bd4c5b3f3689342af9a17a6a1ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9d17de99816333b6ce804aba196ab0a494bbe4c9549f6a3449aa158673f58322dc313ab9e984453ab6a7367d85bd89afc60440f1b2ed89bc82a0e5dd6754ff
|
7
|
+
data.tar.gz: 7af20ea69dbd59dbbca0a6aaebd91fc546d627f0cf4a4d58abbfec045a1b0d9d2bb3cc69f48b4d1c0cae8f270246ede2aee69e9c4c9bba76a12fd1e30fdf9178
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/lib/rollup/aggregator.rb
CHANGED
@@ -51,7 +51,7 @@ class Rollup
|
|
51
51
|
elsif !clear
|
52
52
|
# if no rollups, compute all intervals
|
53
53
|
# if rollups, recompute last interval
|
54
|
-
max_time = Rollup.where(name: name, interval: interval).maximum(Utils.time_sql(interval))
|
54
|
+
max_time = Rollup.unscoped.where(name: name, interval: interval).maximum(Utils.time_sql(interval))
|
55
55
|
if max_time
|
56
56
|
# for MySQL on Ubuntu 18.04 (and likely other platforms)
|
57
57
|
if max_time.is_a?(String)
|
@@ -157,7 +157,7 @@ class Rollup
|
|
157
157
|
def maybe_clear(clear, name, interval)
|
158
158
|
if clear
|
159
159
|
Rollup.transaction do
|
160
|
-
Rollup.where(name: name, interval: interval).delete_all
|
160
|
+
Rollup.unscoped.where(name: name, interval: interval).delete_all
|
161
161
|
yield
|
162
162
|
end
|
163
163
|
else
|
@@ -173,10 +173,10 @@ class Rollup
|
|
173
173
|
|
174
174
|
if ActiveRecord::VERSION::MAJOR >= 6
|
175
175
|
options = Utils.mysql? ? {} : {unique_by: conflict_target}
|
176
|
-
Rollup.upsert_all(records, **options)
|
176
|
+
Rollup.unscoped.upsert_all(records, **options)
|
177
177
|
else
|
178
178
|
update = Utils.mysql? ? [:value] : {columns: [:value], conflict_target: conflict_target}
|
179
|
-
Rollup.import(records,
|
179
|
+
Rollup.unscoped.import(records,
|
180
180
|
on_duplicate_key_update: update,
|
181
181
|
validate: false
|
182
182
|
)
|
data/lib/rollup/version.rb
CHANGED
data/lib/rollups.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -38,106 +38,8 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.2'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '5'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '5'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: activerecord
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: pg
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: mysql2
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: sqlite3
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
41
|
description:
|
140
|
-
email: andrew@
|
42
|
+
email: andrew@ankane.org
|
141
43
|
executables: []
|
142
44
|
extensions: []
|
143
45
|
extra_rdoc_files: []
|
@@ -173,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
75
|
- !ruby/object:Gem::Version
|
174
76
|
version: '0'
|
175
77
|
requirements: []
|
176
|
-
rubygems_version: 3.2.
|
78
|
+
rubygems_version: 3.2.22
|
177
79
|
signing_key:
|
178
80
|
specification_version: 4
|
179
81
|
summary: Rollup time-series data in Rails
|