motor-admin 0.2.17 → 0.2.18

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
  SHA256:
3
- metadata.gz: 43b28780732981472580aa188997c0dadbe63723c896370c75517e43cc8af86d
4
- data.tar.gz: 4be16dd686ef091f7413255df883a740155daa7885c37d600ac23546b839d7fa
3
+ metadata.gz: dc4b3959711130ff5e711c91a8a3ae30f996dcbbf83c98a6d2bb108ffed665e6
4
+ data.tar.gz: c5090823346eb41d62bb400cce5b7c4c4c17b9a9261017aa374a31fa33ca3630
5
5
  SHA512:
6
- metadata.gz: 046de91e00db2c5db533ce5eae691719ae50fb049bd9221a56681e3692fc4b42b8b4a090243b9b7b407c24e3cfb21bb208f2ce24a61e8967c0839dc9181a0a7d
7
- data.tar.gz: a3dbda01e0d6f121ba9b2a90f5cca87bdb67772964627e134e735b4cace582a5a9869087c777069b5c5d5e2a3cc77e49ab843fb25decde19754b5afe64061eee
6
+ metadata.gz: c46b67ac2fe96276806252c3c56e0472b32b6f91aa2351dd7d8ae76485de59260e2079dd42336c61beb1d28de9f6c0177e32e60d9a5e35c9b7dd8b9e770ff0bf
7
+ data.tar.gz: d49105316054eab5561cfbbad123cf4e106d7d837446cab63f91149f225022466c7ef3e10442e20789c4c920e9a222dbf27ad552a253cd23267e71356d34fa68
@@ -16,6 +16,7 @@ module Motor
16
16
  'numeric' => 'float',
17
17
  'decimal' => 'float',
18
18
  'float4' => 'float',
19
+ 'bpchar' => 'string',
19
20
  'float8' => 'float',
20
21
  'float16' => 'float',
21
22
  'text' => 'string',
@@ -43,11 +44,13 @@ module Motor
43
44
 
44
45
  return UNIFIED_TYPES.fetch(name, name) if name
45
46
 
46
- DEFAULT_TYPE
47
+ nil
47
48
  end
48
49
 
49
50
  def build_types_hash
50
- type_map = ActiveRecord::Base.connection.send(:type_map)
51
+ connection_class = defined?(::ResourceRecord) ? ::ResourceRecord : ActiveRecord::Base
52
+
53
+ type_map = connection_class.connection.send(:type_map)
51
54
 
52
55
  type_map.instance_variable_get('@mapping').map do |name, type|
53
56
  next unless name.is_a?(String)
@@ -86,10 +86,10 @@ module Motor
86
86
  result.columns.map.with_index do |column_name, index|
87
87
  column_type_class = result.column_types[column_name]
88
88
 
89
- column_type =
90
- if column_type_class
91
- ActiveRecordUtils::Types.find_name_for_type(column_type_class)
92
- else
89
+ column_type = ActiveRecordUtils::Types.find_name_for_type(column_type_class) if column_type_class
90
+
91
+ column_type ||=
92
+ begin
93
93
  not_nil_value = result.rows.reduce(nil) do |acc, row|
94
94
  column = row[index]
95
95
 
data/lib/motor/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motor
4
- VERSION = '0.2.17'
4
+ VERSION = '0.2.18'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motor-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka