pb-serializer 0.4.0 → 0.5.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: 0edb07851fb2e4ee393ca69ffbcb56ae012cf5e0dc4d55874b3a9364b9dff3d0
4
- data.tar.gz: efdfa935a65fd014dc5e757d92f6e3d4162e45c4352aa4047e360bb0ca1b86c8
3
+ metadata.gz: b46a686595d5e9e919c21ff7e6902cec71be97d716085dc38b8b2ef0192e7cf1
4
+ data.tar.gz: c453986c407e5e567bce43f3f45429697c552dedc44356ffee2a8e0b4d5eaea7
5
5
  SHA512:
6
- metadata.gz: 67a0ca4baa1bbf484a2c0b1b310a5299b0dd35864d87f9aef458f81d0c56e986be80ae2f4a15eb76be2c2f3befc74445674b0b9fc2b14a6b92feeb1438a4f954
7
- data.tar.gz: 0043f9be4bf0a60631463179902b73493e7623a1f59b7d13f32e81f825767f6a0127b0ac4e2d7f3fc80f3b8b0f617c988bce778e3a28653b4e2bf98a8fdd508e
6
+ metadata.gz: c58c5ab0714bd7bee52f3f30ede95b676b849cdf0be482a9de0187287d3ecfd0e758b6cc7c17831965d7e8e54fc13763c6290607330077c3a2135c6fe9cfd439
7
+ data.tar.gz: 7b3cc2224f7550c72714cc21c1e656182891788b1f0aa67b02dce177ea44cb6dfef5115073aeb08eb130fe40decc15551e73bbb2aa6ec77c0fc997e8fbf3477f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.5.0
4
+
5
+ - Bump `computed_model` from 0.2.2 to 0.3.0 https://github.com/wantedly/pb-serializer/pull/38
6
+
3
7
  ## 0.4.0
4
8
 
5
9
  - Make `#initialize` extensible used with `define_primary_loader` https://github.com/wantedly/pb-serializer/pull/31
@@ -1,8 +1,9 @@
1
1
  module Pb
2
2
  module Serializable
3
+ extend ActiveSupport::Concern
4
+ include ComputedModel::Model
3
5
  def self.included(base)
4
6
  base.extend ClassMethods
5
- base.include ComputedModel
6
7
  base.singleton_class.prepend Hook
7
8
  end
8
9
 
@@ -154,6 +155,13 @@ module Pb
154
155
  with = ::Pb::Serializer::NormalizedMask.build(with)
155
156
  with = with.reject { |c| (__pb_serializer_attrs & (c.kind_of?(Hash) ? c.keys : [c])).empty? }
156
157
 
158
+ primary_object_name = __pb_serializer_primary_model_name
159
+ if primary_object_name
160
+ (with[primary_object_name] ||= []) << true
161
+ elsif self < Serializer::Base
162
+ (with[:object] ||= []) << true
163
+ end
164
+
157
165
  bulk_load_and_compute(with, **args)
158
166
  end
159
167
 
@@ -1,5 +1,5 @@
1
1
  module Pb
2
2
  module Serializer
3
- VERSION = "0.4.0".freeze
3
+ VERSION = "0.5.0".freeze
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  rails_versions = [">= 5.2", "< 6.1"]
30
30
  spec.add_runtime_dependency "google-protobuf", "~> 3.0"
31
31
  spec.add_runtime_dependency "the_pb", "~> 0.0.1"
32
- spec.add_runtime_dependency "computed_model", "~> 0.2.2"
32
+ spec.add_runtime_dependency "computed_model", "~> 0.3.0"
33
33
 
34
34
  spec.add_development_dependency "activerecord", rails_versions
35
35
  spec.add_development_dependency "bundler", "~> 2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pb-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - izumin5210
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-14 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.2
47
+ version: 0.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.2
54
+ version: 0.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activerecord
57
57
  requirement: !ruby/object:Gem::Requirement