activerecord-postgres_enum 0.2.1 → 0.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf8acb0b3c01c8e883965fcde17f1c1fb280d3c229f98eb9c49e7dd74fa71fa
|
4
|
+
data.tar.gz: 133f33acd62d7546a183809f512fbfbedd3859535798d469a12101e20d26934b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859272852f26c70f5d0824fc350e10f65cdf9ff503fa64a0985e578a00e9fe0a1366f3bb95d79c869d2872894ecff380cd2c077f5e0236c9af485ad9b3f01a04
|
7
|
+
data.tar.gz: 0e92dd024d589b0c4e52cc784840dfbee7574d2d2cccf2710afa21defd65b16b306807dabb94cd17a0218521c644b2a5b6fe2c323e6e5fcfda1d3b0db81255b6
|
@@ -6,7 +6,7 @@ module ActiveRecord
|
|
6
6
|
DEFINED_ENUMS_QUERY = <<~SQL
|
7
7
|
SELECT t.OID, t.typname, t.typtype, array_agg(e.enumlabel) as enumlabels
|
8
8
|
FROM pg_type t
|
9
|
-
|
9
|
+
LEFT JOIN pg_enum e ON e.enumtypid = t.oid
|
10
10
|
WHERE typtype = 'e'
|
11
11
|
GROUP BY t.OID, t.typname, t.typtype
|
12
12
|
ORDER BY t.typname
|
@@ -14,7 +14,7 @@ module ActiveRecord
|
|
14
14
|
|
15
15
|
def enums
|
16
16
|
select_all(DEFINED_ENUMS_QUERY).each_with_object({}) do |row, memo|
|
17
|
-
memo[row["typname"].to_sym] = row['enumlabels'].gsub(/[{}]/, '').split(',').sort
|
17
|
+
memo[row["typname"].to_sym] = row['enumlabels'].gsub(/[{}]/, '').gsub('NULL', '').split(',').sort
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgres_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Merkushin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|