quby 5.0.0.pre3 → 5.0.0.pre4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddc10a44111cef2b40f5bdacb0e71087d785834eb1870318eb7c98f29cbbfb3e
|
4
|
+
data.tar.gz: 974ad9eca496310b69b7b6c1b99ddd4c37207b83f4bf4e34ab5b21b474792f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e5cde14431489cb85d05cba333d6f4f3daca33d5859ebf7342a127f9a7807822d0376fb24f396799b0049c90d6a965da2827fb9b576af46854836032fbf1c3b
|
7
|
+
data.tar.gz: ed1786bc33ffb3c17ccc49cde2ae7afc6610ee52a57f709e669ebabec761af91c3633ffe75dd46951bb3b0fc447efe4211f5447033208afb32181dbaab33ef28
|
@@ -18,7 +18,7 @@ module Quby
|
|
18
18
|
questionnaire.licensor = json.fetch("licensor")
|
19
19
|
questionnaire.language = json.fetch("language").try(:to_sym)
|
20
20
|
questionnaire.renderer_version = json.fetch("renderer_version")
|
21
|
-
questionnaire.last_update = json.fetch("last_update")
|
21
|
+
questionnaire.last_update = Time.zone.parse(json.fetch("last_update"))
|
22
22
|
questionnaire.last_author = json.fetch("last_author")
|
23
23
|
questionnaire.extra_css = json.fetch("extra_css")
|
24
24
|
questionnaire.allow_switch_to_bulk = json.fetch("allow_switch_to_bulk")
|
@@ -371,7 +371,7 @@ module Quby
|
|
371
371
|
y_categories: chart_json.fetch("y_categories"),
|
372
372
|
y_range_categories: chart_json.fetch("y_range_categories"),
|
373
373
|
chart_type: chart_json.fetch("chart_type"),
|
374
|
-
y_range: chart_json.fetch("y_range"),
|
374
|
+
y_range: deserialize_range(chart_json.fetch("y_range")),
|
375
375
|
tick_interval: chart_json.fetch("tick_interval"),
|
376
376
|
plotbands: chart_json.fetch("plotbands").map do |plotband_json|
|
377
377
|
{
|
@@ -429,6 +429,11 @@ module Quby
|
|
429
429
|
default_collapsed: attributes.fetch("default_collapsed"),
|
430
430
|
)
|
431
431
|
end
|
432
|
+
|
433
|
+
def self.deserialize_range(range_attributes)
|
434
|
+
return unless range_attributes
|
435
|
+
Range.new(range_attributes.fetch("begin"), range_attributes.fetch("end"), range_attributes.fetch("exclude_end"))
|
436
|
+
end
|
432
437
|
end
|
433
438
|
end
|
434
439
|
end
|
@@ -41,17 +41,17 @@ module Quby
|
|
41
41
|
def make_baseline_proc
|
42
42
|
return unless @baseline
|
43
43
|
|
44
|
-
case
|
44
|
+
case @baseline
|
45
45
|
when Hash
|
46
46
|
->(age, gender) {
|
47
|
-
age_match =
|
48
|
-
hash_by_gender = (age_match&.last ||
|
47
|
+
age_match = @baseline.find { |age_range, _v| age && age_range === age }
|
48
|
+
hash_by_gender = (age_match&.last || @baseline.stringify_keys["default"])
|
49
49
|
|
50
50
|
gender_match = hash_by_gender.find {|gender_key, _v| gender && gender_key.to_s == gender.to_s }
|
51
51
|
gender_match&.last || hash_by_gender.stringify_keys['default']
|
52
52
|
}
|
53
53
|
else
|
54
|
-
|
54
|
+
->(age, gender) { @baseline }
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
data/lib/quby/version.rb
CHANGED