insights_export 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/insights_export/export_models.rb +12 -10
- data/lib/insights_export/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af9921e9afa2d95cfb2ac792f39e51d0ce874c3b
|
4
|
+
data.tar.gz: abae2922706e2263587557c17cd59f916908664b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 723a8e57a3a4a2b983ae8eb950716f7ae420279920ae7b37b5e3000ffd3f0cb0d36f89099341e00d5e5c9a96c863c5fa971089c747c0278832de0c5787709e36
|
7
|
+
data.tar.gz: 86aef329875d0038ad2ede96ca478e697e42b03d986856c1cdc0788942b117407764947dcb46b3dac8150e82daa5f93012d76985708d1e8ac985d557815301a3
|
@@ -93,34 +93,36 @@ module InsightsExport
|
|
93
93
|
return_object = {}
|
94
94
|
|
95
95
|
models.each do |model|
|
96
|
-
columns_hash = model.columns_hash
|
97
|
-
|
98
96
|
begin
|
97
|
+
columns_hash = model.columns_hash
|
98
|
+
|
99
99
|
model_structure = {
|
100
100
|
enabled: true,
|
101
101
|
model: model.to_s,
|
102
102
|
table_name: model.table_name,
|
103
103
|
primary_key: model.primary_key,
|
104
104
|
columns: columns_hash.map do |key, column|
|
105
|
-
obj = if column.type.in? %i(datetime
|
106
|
-
{ type:
|
105
|
+
obj = if column.type.in? %i(datetime)
|
106
|
+
{ type: 'time' }
|
107
|
+
elsif column.type.in? %i(date)
|
108
|
+
{ type: 'date' }
|
107
109
|
elsif column.type.in? %i(integer decimal float)
|
108
|
-
{ type:
|
110
|
+
{ type: 'number' }
|
109
111
|
elsif column.type.in? %i(string text)
|
110
|
-
{ type:
|
112
|
+
{ type: 'string' }
|
111
113
|
elsif column.type.in? %i(boolean)
|
112
|
-
{ type:
|
114
|
+
{ type: 'boolean' }
|
113
115
|
elsif column.type.in? %i(json)
|
114
|
-
{ type:
|
116
|
+
{ type: 'payload' }
|
115
117
|
elsif column.type.in? %i(geography)
|
116
|
-
{ type:
|
118
|
+
{ type: 'geo' }
|
117
119
|
else
|
118
120
|
puts "Warning! Unknown column type: :#{column.type} for #{model.to_s}, column #{key}"
|
119
121
|
{ unknown: column.type }
|
120
122
|
end
|
121
123
|
|
122
124
|
if key == model.primary_key
|
123
|
-
obj[:index] =
|
125
|
+
obj[:index] = 'primary_key'
|
124
126
|
end
|
125
127
|
|
126
128
|
[key.to_sym, obj]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: insights_export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marius Andra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|