protip 0.37.1 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b29978429d180c9023e5b11f34c954942c7b3e020f2fff71dc492e603b7264af
4
- data.tar.gz: 9e9a92cda97821f100f26d63267e33058f1f11e552ed17c65778f5530eda1973
3
+ metadata.gz: 172d3da1071ab9cb169de768fd866b054de8957e830f5dac1861b28b0b9e9e68
4
+ data.tar.gz: 42112bdd76fffd494ff6a72758e8fdc02c9b3e972bf2c934059445f67d9d9d28
5
5
  SHA512:
6
- metadata.gz: a227d2e7c9737ab476b34147ed48b82923020f3bf91f6d9f2d03af2377b61dae50e942994b25f050fd45953a395ea6d35806c89c9ee5a1a1618700ebb4ab6615
7
- data.tar.gz: 1d86e0454c130c97ab6c02fbbab114c8152b11cd29338064c23a460e96250bc70d488a2fe8a7b3d487315df9f075f4b70288991af95e64908cf9c3692578f4fe
6
+ metadata.gz: f63483c95b7922686445e0afad410c7492434f31ba3ab09cc5bfae63a73d85b6859a373d74bcb78f128f4c3428d24c51a4172cbbf2f833991b0ee1ca68c74b54
7
+ data.tar.gz: 3be5f63cbd900dd2222476bf4931f4fe1c0068ff9ad578c7f27c1cb65bf305ed166a401684187dac045ec96247aa1bd1a0fc87cd0df17b31ecd3ef726f5ca647
@@ -243,7 +243,7 @@ module Protip
243
243
  def to_protobuf_value(field, value)
244
244
  if field.type == :message
245
245
  if nil == value
246
- nil
246
+ field&.default || field&.subtype&.msgclass&.new
247
247
  # This check must happen before the nested_resources check to
248
248
  # ensure nested messages are set properly
249
249
  elsif value.is_a?(field.subtype.msgclass)
@@ -61,4 +61,4 @@ module Protip
61
61
  end
62
62
  end
63
63
  end
64
- end
64
+ end
@@ -235,7 +235,7 @@ module Protip
235
235
  end
236
236
 
237
237
  def belongs_to(association_name, options = {})
238
- association = ::Protip::Resource::Associations::BelongsToAssociation.new(self, association_name, options)
238
+ association = ::Protip::Resource::Associations::BelongsToAssociation.new(self, association_name, **options)
239
239
  association.define_accessors!
240
240
  @belongs_to_associations.add association
241
241
  association
@@ -260,7 +260,7 @@ module Protip
260
260
  nested_association_creator.instance_eval(&block)
261
261
 
262
262
  association = ::Protip::Resource::Associations::BelongsToPolymorphicAssociation.new self,
263
- association_name, nested_association_creator.associations, options
263
+ association_name, nested_association_creator.associations, **options
264
264
  association.define_accessors!
265
265
  @belongs_to_polymorphic_associations.add association
266
266
  association
@@ -1,3 +1,3 @@
1
1
  module Protip
2
- VERSION = '0.37.1'
2
+ VERSION = '0.38.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.1
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AngelList
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2023-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel