sql_enum 0.1.14 → 0.1.15

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: 722654e79cd248cfd83f5c209c7d03d472ab91f1
4
- data.tar.gz: 4004618dba1b0f24c6aa2936d8ae0ad2268f7634
3
+ metadata.gz: bbdc4298751fcb22bf9202ed9609243029a9afc0
4
+ data.tar.gz: 46b77e14cff461533788f0e0be634332a6d13cb6
5
5
  SHA512:
6
- metadata.gz: 3c422d1c34187b0f732e20074c3e62a59de75fc45c30132adb3115e5362074ae7319f606c3e579dcd7e321ff4ec6a783fe1e0a48a2474003ffd6b13634f5ac79
7
- data.tar.gz: 7ec4205ba6f6fee021fa2e406b99c11dd7c989b4fd966032c315393717941d33097fec8c3cfd6cd3377dbca3bc8cb5c1c727de98334bf3962b0dff6a792a69ba
6
+ metadata.gz: 53ee10ec498793598c1a6cc5ca85e56ddee4cda19fe0efe61ef289d4e48061b072c24a4207eda7f164fd7d42a255b7c0da028bc4f25755348e18305d60617955
7
+ data.tar.gz: cb9a81b374bef580ae1fa2321d7a1f6f763acf2bd5a704f5fbf0f5bfb80c774e6d79db1138c123ef8155e0780a1b087c34d6c0a6f484e115aae7eb3019c760f6
@@ -62,11 +62,16 @@ module ActiveRecord
62
62
  ActiveRecord::Base.connection.exec_query(schema_values_query(name)).rows.dig(0,0)
63
63
  end
64
64
 
65
+ def database_name
66
+ ActiveRecord::Base.connection_config[:database]
67
+ end
68
+
65
69
  def schema_values_query(name)
66
70
  %{
67
71
  SELECT column_type
68
72
  FROM information_schema.COLUMNS
69
- WHERE TABLE_NAME = '#{self.table_name}'
73
+ WHERE TABLE_SCHEMA = '#{database_name}'
74
+ AND TABLE_NAME = '#{table_name}'
70
75
  AND COLUMN_NAME = '#{name}'
71
76
  }
72
77
  end
@@ -1,3 +1,3 @@
1
1
  module SqlEnum
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Fowler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-09 00:00:00.000000000 Z
11
+ date: 2018-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord