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: ac1a4050078ae617f956c4edec5bc5a3df17938afad14748fac7514e2ed19334
4
- data.tar.gz: a8fcd0f62745631af282bc70f8feae60bb04babd8c0506541c72655e18bb2499
3
+ metadata.gz: cdf8acb0b3c01c8e883965fcde17f1c1fb280d3c229f98eb9c49e7dd74fa71fa
4
+ data.tar.gz: 133f33acd62d7546a183809f512fbfbedd3859535798d469a12101e20d26934b
5
5
  SHA512:
6
- metadata.gz: 9167d8104022e7c1883c14efdee7e85e3298a107a032a0d974afd694b159140a75ce29a2228b096d12808ef68292795e798a6db29e3adfb4600094e094c83807
7
- data.tar.gz: 8a4fa76eeaa7009ae11880863c760dba1cf5e326bdbe492c6d1c8acad1ce3a2e42d712b7c0cb968b84844891a28b51aa3740d2902b9d3a05de39d5181c3645c1
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
- INNER JOIN pg_enum e ON e.enumtypid = t.oid
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module PostgresEnum
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
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.1
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-15 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord