renalware-core 2.0.26 → 2.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3db179c3655e0116ae6346710b5ab13ee30478ebf6155dd148ed4297481b71cb
|
|
4
|
+
data.tar.gz: d6dec13d3ed966b1a334dcf1ed7a760b03f0745140b1fe91c2e2842060d91dc8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c42e3954747469956ebafe5df3a8228530ac36d2196ec541f08661c99a80be74167bc3c864ed9224e77bcd74d7e876f5ef8bc77fa6c00af3e74f040e2b98082e
|
|
7
|
+
data.tar.gz: cead17eef7473469f7d8fe9b31a99890e601a3d98f68098b0caa5a4d5e10270e97357b18a7871c29557dc18bbc577e32530876621d4e8ccf7dfadfe38c0f55c4
|
|
@@ -16,16 +16,18 @@ class DatePickerInput < SimpleForm::Inputs::StringInput
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
# rubocop:disable Metrics/AbcSize
|
|
19
20
|
def input_column(_wrapper_options = {})
|
|
20
21
|
html_options = input_html_options
|
|
21
22
|
html_options[:class] ||= []
|
|
22
23
|
html_options[:class] << class_name
|
|
23
24
|
template.content_tag(:div, class: "small-10 columns") do
|
|
24
25
|
datestamp = @builder.object.public_send(attribute_name)
|
|
25
|
-
value =
|
|
26
|
+
value = format_date(datestamp)
|
|
26
27
|
template.concat @builder.text_field(attribute_name, html_options.merge(value: value))
|
|
27
28
|
end
|
|
28
29
|
end
|
|
30
|
+
# rubocop:enable Metrics/AbcSize
|
|
29
31
|
|
|
30
32
|
def icon_calendar
|
|
31
33
|
"<span class='prefix'><i class='fa fa-calendar'></i></span>".html_safe
|
|
@@ -38,4 +40,20 @@ class DatePickerInput < SimpleForm::Inputs::StringInput
|
|
|
38
40
|
def class_name
|
|
39
41
|
"datepicker"
|
|
40
42
|
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
# Note that datestamp will be some kind of Date object *unless* its an invalid date string
|
|
47
|
+
# e.g. "12-00-2010" that has for example been imported from another system, and its one we
|
|
48
|
+
# happen to store in Rw2 in jsonb where there is no database type checking.
|
|
49
|
+
# We have seen this in LowClerance::Profile.document.
|
|
50
|
+
# So if we get an error converting an invalid date string, return it as is and let the
|
|
51
|
+
# user correct it in the UI. Note that without this error handling, the user will
|
|
52
|
+
# not be able to view the form to correct the data.
|
|
53
|
+
def format_date(datestamp)
|
|
54
|
+
return "" if datestamp.blank?
|
|
55
|
+
I18n.l(datestamp)
|
|
56
|
+
rescue I18n::ArgumentError # e.g. its a string containing an invalid date
|
|
57
|
+
datestamp
|
|
58
|
+
end
|
|
41
59
|
end
|
|
@@ -22,7 +22,7 @@ module Renalware
|
|
|
22
22
|
def validate_diastolic_less_than_systolic(bp)
|
|
23
23
|
errors = bp.errors
|
|
24
24
|
return if errors.any?
|
|
25
|
-
unless bp.diastolic < bp.systolic
|
|
25
|
+
unless bp.diastolic.to_f < bp.systolic.to_f
|
|
26
26
|
errors.add(:diastolic, :must_be_less_than_systolic)
|
|
27
27
|
end
|
|
28
28
|
end
|
data/lib/renalware/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: renalware-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.27
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Airslie
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-05-
|
|
11
|
+
date: 2018-05-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: active_type
|