pg_serializable 2.1.0 → 2.1.1

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: bd14d72e8ae968ca82c8d942dd59056889b621a2d2490a0d132eb675f6feeabe
4
- data.tar.gz: 3236fe936f598c506fccae3125260ca65bcbcb2485a41f3001f0143007f14b32
3
+ metadata.gz: 7a6b84a108ee7251260d5815a6f39ace9730f09fa9afb4c021c4dba595518b44
4
+ data.tar.gz: 79eedfdfffe000fc9a6d9099f64d531ec3700477e4f36d3533f986a09b93158e
5
5
  SHA512:
6
- metadata.gz: '08721b56888fe99f793a38b4d5496472f471292cd3b29f0975865670a0b8b1583f8f42528889e16d6270a03594022fd8826ff9f48ad6b86f3c8b7ffb5fcd66c8'
7
- data.tar.gz: 8476bc8dec28bb82de7b1d31a4f6ebde6d7486031c6ec65e7e27cb07e9013def389f85fe042314519b71ec69bb078b6ac9cfbaf590b37ae7aa9d2b658f4b2dec
6
+ metadata.gz: 939ad158799faa8bf26ac8066604dcbd4ddcc13b5483fdaf663f3dd41416d590c1c9272d376f62443abb02a95bfe691f4c1505c426f3d87fae96416c9374f494
7
+ data.tar.gz: 90c4807f5c2ef239653444f97aeb0dd72c602bc4dcc9a52dfd27a3e07e09ea748aa886a91d82577bd422061ef3298f642225bc9002fa564e5c21b9e3dc2b87c3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg_serializable (2.0.0)
4
+ pg_serializable (2.1.1)
5
5
  activerecord (>= 5.2, < 7.0)
6
6
  activesupport (>= 5.2, < 7.0)
7
7
  oj (~> 3.6)
@@ -1,3 +1,3 @@
1
1
  module PgSerializable
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -56,8 +56,8 @@ module PgSerializable
56
56
  key = "\'#{subject.label}\'"
57
57
  enum_hash = subject.klass.defined_enums[subject.column_name.to_s]
58
58
  val = "CASE \"#{table_alias}\".\"#{subject.column_name}\" " +
59
- enum_hash.map do |val, int|
60
- "WHEN #{int} THEN \'#{subject.prc ? subject.prc.call(val) : val}\'"
59
+ enum_hash.map do |enum_key, enum_value|
60
+ "WHEN #{enum_value.is_a?(String) ? "'#{enum_value}'" : enum_value} THEN \'#{subject.prc ? subject.prc.call(enum_key) : enum_key}\'"
61
61
  end.join(' ') + " ELSE NULL END"
62
62
  "#{key}, #{val}"
63
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_serializable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - matthewjf
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2019-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler