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 +4 -4
- data/lib/active_record/enum_override.rb +6 -1
- data/lib/sql_enum/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: bbdc4298751fcb22bf9202ed9609243029a9afc0
|
4
|
+
data.tar.gz: 46b77e14cff461533788f0e0be634332a6d13cb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
73
|
+
WHERE TABLE_SCHEMA = '#{database_name}'
|
74
|
+
AND TABLE_NAME = '#{table_name}'
|
70
75
|
AND COLUMN_NAME = '#{name}'
|
71
76
|
}
|
72
77
|
end
|
data/lib/sql_enum/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|