standardapi 5.2.0.2 → 5.2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_api/version.rb +1 -1
- data/lib/standard_api/views/application/schema.json.jbuilder +41 -24
- 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: bed2d365e455efd7b10470b8c6fb2254cdda2f4ea38f3f821f868db6927da2bf
|
4
|
+
data.tar.gz: 9d6baea8ba6b153385e08bea5627c0e92b9408e1b4c44ebd730c1f5789a29865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 610394e5483d37878c0ad00305f42f19d3cd30226cfb647a70c4fa3b6419cb1eae8d74eeb59fee5079ad9d111c04b29380d78d99d7faaeb3c24293838d31d786
|
7
|
+
data.tar.gz: f2ee74383eb29528dd8c99f6f7c10787870397ee7784235c9e74362b6c08b3a191803afcc4e4aab320fc03375d5477a7161ebb367220f24f9563538c7c9d52d5
|
data/lib/standard_api/version.rb
CHANGED
@@ -1,31 +1,48 @@
|
|
1
|
-
mapping =
|
2
|
-
|
3
|
-
|
4
|
-
'
|
5
|
-
|
6
|
-
'
|
7
|
-
|
8
|
-
'
|
9
|
-
|
10
|
-
'
|
11
|
-
|
12
|
-
'
|
13
|
-
|
14
|
-
'
|
15
|
-
|
16
|
-
'
|
17
|
-
|
18
|
-
'
|
19
|
-
|
20
|
-
'
|
21
|
-
|
22
|
-
'
|
23
|
-
|
1
|
+
mapping = lambda do |sql_type|
|
2
|
+
case sql_type
|
3
|
+
when /character varying(\(\d+\))?/
|
4
|
+
'string'
|
5
|
+
when 'timestamp without time zone'
|
6
|
+
'datetime'
|
7
|
+
when 'time without time zone'
|
8
|
+
'datetime'
|
9
|
+
when 'text'
|
10
|
+
'string'
|
11
|
+
when 'json'
|
12
|
+
'hash'
|
13
|
+
when 'bigint'
|
14
|
+
'integer'
|
15
|
+
when 'integer'
|
16
|
+
'integer'
|
17
|
+
when 'jsonb'
|
18
|
+
'hash'
|
19
|
+
when 'inet'
|
20
|
+
'string' # TODO: should be inet
|
21
|
+
when 'hstore'
|
22
|
+
'hash'
|
23
|
+
when 'date'
|
24
|
+
'datetime'
|
25
|
+
when 'numeric(162)'
|
26
|
+
'decimal'
|
27
|
+
when 'numeric'
|
28
|
+
'decimal'
|
29
|
+
when 'double precision'
|
30
|
+
'decimal'
|
31
|
+
when 'ltree'
|
32
|
+
'string'
|
33
|
+
when 'boolean'
|
34
|
+
'boolean'
|
35
|
+
when 'geometry'
|
36
|
+
'ewkb'
|
37
|
+
when 'uuid' # TODO: should be uuid
|
38
|
+
'string'
|
39
|
+
end
|
40
|
+
end
|
24
41
|
|
25
42
|
json.set! 'columns' do
|
26
43
|
model.columns.each do |column|
|
27
44
|
json.set! column.name, {
|
28
|
-
type: mapping
|
45
|
+
type: mapping.call(column.sql_type),
|
29
46
|
primary_key: column.name == model.primary_key,
|
30
47
|
null: column.null,
|
31
48
|
array: column.array
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standardapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.0.
|
4
|
+
version: 5.2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|