pg_serializable 2.1.1 → 3.0.0

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: 7a6b84a108ee7251260d5815a6f39ace9730f09fa9afb4c021c4dba595518b44
4
- data.tar.gz: 79eedfdfffe000fc9a6d9099f64d531ec3700477e4f36d3533f986a09b93158e
3
+ metadata.gz: 10817b9de01f59f3048155e50dc69639818f302e715047785a7ac309fb5ffb72
4
+ data.tar.gz: 040e4184a1029f9b86f6af4fc8c0cc5aca6348326e0e1f5a1fd5a62d1c447fe1
5
5
  SHA512:
6
- metadata.gz: 939ad158799faa8bf26ac8066604dcbd4ddcc13b5483fdaf663f3dd41416d590c1c9272d376f62443abb02a95bfe691f4c1505c426f3d87fae96416c9374f494
7
- data.tar.gz: 90c4807f5c2ef239653444f97aeb0dd72c602bc4dcc9a52dfd27a3e07e09ea748aa886a91d82577bd422061ef3298f642225bc9002fa564e5c21b9e3dc2b87c3
6
+ metadata.gz: 278d6800ea8c45679a157d0c28edfa53d7fa5e9ab28a28763522d57c06c2419f5d242a07bc8f6b4861a72c78d26c519ac2d92adc865c6e8498d7d13aaa72532c
7
+ data.tar.gz: d43a363ed01c719457bc4e49a963c2dbd96afd41306174c62e7287774500624b61fe70a4dd85610a4df903eda6120dc34c497cf5457553da7d6707d0789e5d65
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg_serializable (2.1.1)
4
+ pg_serializable (3.0.0)
5
5
  activerecord (>= 5.2, < 7.0)
6
6
  activesupport (>= 5.2, < 7.0)
7
7
  oj (~> 3.6)
data/README.md CHANGED
@@ -7,6 +7,23 @@
7
7
 
8
8
  Serialize json directly from postgres (9.4+).
9
9
 
10
+ ## Upgrading from version 2.x.x to 3.x.x
11
+
12
+ Serialization returns a PORO instead of a json string. If you have code like:
13
+ ```ruby
14
+ OJ.load(Product.where(id: ids).json)
15
+ ```
16
+
17
+ You can replace it with:
18
+ ```ruby
19
+ Product.where(id: ids).json
20
+ ```
21
+
22
+ To automatically use OJ to serialize your POROs to json strings, add this code to your initialization:
23
+ ```ruby
24
+ Oj.optimize_rails()
25
+ ```
26
+
10
27
  ## Motivation
11
28
  Models:
12
29
  ```ruby
@@ -57,7 +57,7 @@ module PgSerializable
57
57
 
58
58
  def to_pg_json(scope)
59
59
  res = scope.as_json.first
60
- ::Oj.dump(res['coalesce'] || res['json_build_object'])
60
+ res['coalesce'] || res['json_build_object']
61
61
  end
62
62
 
63
63
  private
@@ -1,3 +1,3 @@
1
1
  module PgSerializable
2
- VERSION = "2.1.1"
2
+ VERSION = "3.0.0"
3
3
  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.1
4
+ version: 3.0.0
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-28 00:00:00.000000000 Z
11
+ date: 2019-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -248,8 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  - !ruby/object:Gem::Version
249
249
  version: '0'
250
250
  requirements: []
251
- rubyforge_project:
252
- rubygems_version: 2.7.6
251
+ rubygems_version: 3.0.4
253
252
  signing_key:
254
253
  specification_version: 4
255
254
  summary: serializes rails models from postgres (9.5+)