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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f5e81738b025c008f1d2497d2cc0dcb8d124c42
4
- data.tar.gz: 0ba893949615be6531003e4d1904e3608552f034
3
+ metadata.gz: af9921e9afa2d95cfb2ac792f39e51d0ce874c3b
4
+ data.tar.gz: abae2922706e2263587557c17cd59f916908664b
5
5
  SHA512:
6
- metadata.gz: aacf1cf4ad557cb8b514d1fabbf99c81cc4ab56fdc235595502dc727a753d5b046b983473a01b52623820bf9b3ba925175e97f46d3fbe286088cc45280d806c4
7
- data.tar.gz: 32db48cea7412fee70fd7ffda62d6976807d904477f544392da69843baef643e61633c5a2b1cc2309e3ede75cb171873386828cd0672ae8b44d4aec697c24a84
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 date)
106
- { type: :time }
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: :number }
110
+ { type: 'number' }
109
111
  elsif column.type.in? %i(string text)
110
- { type: :string }
112
+ { type: 'string' }
111
113
  elsif column.type.in? %i(boolean)
112
- { type: :boolean }
114
+ { type: 'boolean' }
113
115
  elsif column.type.in? %i(json)
114
- { type: :payload }
116
+ { type: 'payload' }
115
117
  elsif column.type.in? %i(geography)
116
- { type: :geo }
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] = :primary_key
125
+ obj[:index] = 'primary_key'
124
126
  end
125
127
 
126
128
  [key.to_sym, obj]
@@ -1,3 +1,3 @@
1
1
  module InsightsExport
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake