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: 2c236921f30ba92d324fbf5a6dbce5ecc8d3a3545d87d569aac256d38fb07cf7
4
- data.tar.gz: 96280b81678975fa81b37179acf8897520dfc2b5a9e789040df7c272c5997349
3
+ metadata.gz: 00cd621849bf263dd9915b3abf6fd183a4a314710147b2650a51424ae6df4c82
4
+ data.tar.gz: b9837b83fd0cf963da31dc90f830b9a05fff1cf433f42692ff0fc8c83810e183
5
5
  SHA512:
6
- metadata.gz: c69239c775a3da2f7451e66b800ff0887b813cd9f61f3a314f693e46c78120a332c556ae2b0f93b70040aadb9c7c7e70a6c6da821c4d84073ad45fb7baf75a0c
7
- data.tar.gz: 8ffa86b1fd8eb3d713f616b4941fd8a77a015c2a94d0e7dd7347dfde9f0816f262186b54de099b71319e5b840fed1842f62e5ae220b8fb01ce9652277025f5f3
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
- atype = attribute_types[name.to_s].type
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
- if %i[datetime date time].include?(atype)
78
- return {
79
- type: "string",
80
- format: atype
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: atype }
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
@@ -10,7 +10,7 @@ module Rhino
10
10
  MAJOR = 0
11
11
  MINOR = 30
12
12
  TINY = 0
13
- PRE = "alpha.5"
13
+ PRE = "alpha.7"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhino_project_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0.alpha.5
4
+ version: 0.30.0.alpha.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Rosevear