rhino_project_core 0.30.0.alpha.5 → 0.30.0.alpha.7
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: 00cd621849bf263dd9915b3abf6fd183a4a314710147b2650a51424ae6df4c82
|
4
|
+
data.tar.gz: b9837b83fd0cf963da31dc90f830b9a05fff1cf433f42692ff0fc8c83810e183
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65c31457636e04b633912fb9eb1b164d042f7d55c8e65a4a1f2f48ea40900ab2e86dc110f2f4792928cefd424a0a7119334cc7c3589939f77b32cad7c203acf6
|
7
|
+
data.tar.gz: 120246ea15e61cdbd792d3817ee5b1c6feb225b3f7b4fe5222bdeae9d9d025eee006ee3dea80007f49859a3e3514cb4fef982eebec19b91a5de124cc260988f0
|
@@ -61,27 +61,35 @@ module Rhino
|
|
61
61
|
}
|
62
62
|
end
|
63
63
|
|
64
|
+
DATE_FORMATS = %i[datetime date time].freeze
|
64
65
|
def property_type_and_format_attr(name)
|
65
|
-
|
66
|
+
type = attribute_types[name.to_s].type
|
67
|
+
format = nil
|
66
68
|
|
67
69
|
# The PG array delegates type to "subtype" which is the actual type of the array elements
|
68
70
|
if attribute_types[name.to_s].is_a? ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array
|
69
71
|
return {
|
70
72
|
type: :array,
|
71
|
-
items: {
|
72
|
-
type: atype
|
73
|
-
}
|
73
|
+
items: { type: }
|
74
74
|
}
|
75
75
|
end
|
76
76
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
# Identifier is a special format for identification on the front end
|
78
|
+
format = :identifier if name == identifier_property
|
79
|
+
|
80
|
+
# Float is double precision in postgres by default
|
81
|
+
if type == :float
|
82
|
+
type = :number
|
83
|
+
format = :double
|
84
|
+
end
|
85
|
+
|
86
|
+
# Dates and times are strings
|
87
|
+
if DATE_FORMATS.include?(type)
|
88
|
+
format = type
|
89
|
+
type = :string
|
82
90
|
end
|
83
91
|
|
84
|
-
{ type:
|
92
|
+
{ type:, format: }.compact
|
85
93
|
end
|
86
94
|
|
87
95
|
def nested_array_options(name)
|
@@ -126,7 +134,6 @@ module Rhino
|
|
126
134
|
|
127
135
|
def property_type_and_format(name) # rubocop:disable Metrics/AbcSize
|
128
136
|
# Special cases
|
129
|
-
return { type: :identifier } if name == identifier_property
|
130
137
|
return { type: :string } if defined_enums.key?(name)
|
131
138
|
|
132
139
|
# FIXME: Hack for tags for now
|
data/lib/rhino/version.rb
CHANGED