groupdate 5.2.0 → 5.2.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 +5 -0
- data/lib/groupdate/relation_builder.rb +3 -3
- data/lib/groupdate/series_builder.rb +27 -8
- 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: 448e7901aa2448bca591568110960048d18ac0f21faa5c3cae566fc4a6de30c4
|
4
|
+
data.tar.gz: ba242e41103ae9d2542ff0509de1f454f58142957f0da190482769a42a152887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91b008f8ee0d9ad419ec042ee2f417b621fba09793b223705a2898fe21083a09527885ead3be2d3b8003427473d1f996938098c9bd7139bcb9bffdad2810734c
|
7
|
+
data.tar.gz: d4eb493bdf4b7f40eda2733003263bee49e62f9f69fb6239bec118d1768ce0630c21244e819147ca6b5b1556a9b5e125ed69748e2ee69d3c325f31a2740a6ec5
|
data/CHANGELOG.md
CHANGED
@@ -194,12 +194,12 @@ module Groupdate
|
|
194
194
|
if @time_range.end
|
195
195
|
op = @time_range.exclude_end? ? "<" : "<="
|
196
196
|
if @time_range.begin
|
197
|
-
["#{column} >= ? AND #{column} #{op} ?", @time_range.
|
197
|
+
["#{column} >= ? AND #{column} #{op} ?", @time_range.begin, @time_range.end]
|
198
198
|
else
|
199
|
-
["#{column} #{op} ?", @time_range.
|
199
|
+
["#{column} #{op} ?", @time_range.end]
|
200
200
|
end
|
201
201
|
else
|
202
|
-
["#{column} >= ?", @time_range.
|
202
|
+
["#{column} >= ?", @time_range.begin]
|
203
203
|
end
|
204
204
|
else
|
205
205
|
["#{column} IS NOT NULL"]
|
@@ -141,16 +141,35 @@ module Groupdate
|
|
141
141
|
def time_range
|
142
142
|
@time_range ||= begin
|
143
143
|
time_range = options[:range]
|
144
|
-
|
145
|
-
if time_range.is_a?(Range)
|
146
|
-
|
147
|
-
|
144
|
+
|
145
|
+
if time_range.is_a?(Range)
|
146
|
+
# check types
|
147
|
+
[time_range.begin, time_range.end].each do |v|
|
148
|
+
case v
|
149
|
+
when nil, Date, Time
|
150
|
+
# good
|
151
|
+
when String
|
152
|
+
# TODO raise error in Groupdate 6
|
153
|
+
warn "[groupdate] Range bounds should be Date or Time, not #{v.class.name}. This will raise an error in Groupdate 6"
|
154
|
+
break
|
155
|
+
else
|
156
|
+
raise ArgumentError, "Range bounds should be Date or Time, not #{v.class.name}"
|
157
|
+
end
|
148
158
|
end
|
149
|
-
|
150
|
-
|
151
|
-
|
159
|
+
|
160
|
+
start = time_range.begin
|
161
|
+
start = start.in_time_zone(time_zone) if start
|
162
|
+
|
163
|
+
exclude_end = time_range.exclude_end?
|
164
|
+
|
165
|
+
finish = time_range.end
|
166
|
+
finish = finish.in_time_zone(time_zone) if finish
|
167
|
+
if time_range.end.is_a?(Date) && !exclude_end
|
168
|
+
finish += 1.day
|
169
|
+
exclude_end = true
|
152
170
|
end
|
153
|
-
|
171
|
+
|
172
|
+
time_range = Range.new(start, finish, exclude_end)
|
154
173
|
elsif !time_range && options[:last]
|
155
174
|
if period == :quarter
|
156
175
|
step = 3.months
|
data/lib/groupdate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groupdate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.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: 2020-09-
|
11
|
+
date: 2020-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|