deimos-ruby 2.4.0.pre.beta4 → 2.4.0.pre.beta6

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: 9298b8ea8234c1dedef0ad98a8fbf83dff802e712ceff5ea700001f5eda140e8
4
- data.tar.gz: f0e77ae5b151928e24ac7bc00edeab1157585e99945733486a4adff94c7b4715
3
+ metadata.gz: 70f44ace58c9ddba1a75821d6c661382637233f569c9dd46ac79b9d8afcb83a2
4
+ data.tar.gz: 14dcd940472f5d5ddf21f3eb8903ce7278b224f8e63c7e151706adfb3b635d99
5
5
  SHA512:
6
- metadata.gz: 768daea56a83f749538b88b1d76746428c0d5f8062c95b335700e8798e83a2f9cc41f86920ee75e310507836281f667a3a5060c32707e7dcad97f5c54ba62473
7
- data.tar.gz: c48feac28ad91d649596db0d2c20ee282ce0c9b6a87c6b8b752609bb888d58962b6c2a99c57d4ef60d3cbb0873005c1ba4ec59d42eb4852720a5a56c52925941
6
+ metadata.gz: b094b994d33ff3c6807bafbaccaa44f5daf33cdc04256a104ce26fe69aed2fa64e64c79a3a923e47fdd40d98341ec3c62256d09649f08c140fda4b89b861030c
7
+ data.tar.gz: d88cc52c19c999ce3bd381cee9cc322331e18a68bd9bd5b2fc6c587739266b9db2cd9dad2b945272bcc1e1ce8f3b13295baa0a1f324b854f2223c3a3944d5b1b
@@ -56,7 +56,9 @@ module Deimos
56
56
  assign_key(record, message.payload, message.key)
57
57
  end
58
58
 
59
- attrs = record_attributes((message.payload || {}).with_indifferent_access, message.key)
59
+ payload = message.payload || {}
60
+ payload = payload.with_indifferent_access if payload.is_a?(Hash)
61
+ attrs = record_attributes(payload, message.key)
60
62
  # don't use attributes= - bypass Rails < 5 attr_protected
61
63
  attrs.each do |k, v|
62
64
  record.send("#{k}=", v)
@@ -119,10 +119,10 @@ module Deimos
119
119
  topic: topic,
120
120
  partition_key: self.partition_key(p)
121
121
  }
122
- if m.dig(:payload, :key).present? && m.dig(:payload, :message).present?
123
- m[:key] = m[:payload][:key]
122
+ if payload.is_a?(Hash) && payload.key?(:key) && payload.key?(:message)
123
+ m[:key] = payload[:key]
124
124
  m[:key] = m[:key].to_h if m[:key].nil? || m[:key].is_a?(SchemaClass::Record)
125
- m[:payload] = m[:payload][:message]
125
+ m[:payload] = payload[:message]
126
126
  m[:payload] = m[:payload].to_h if m[:payload].nil? ||
127
127
  m[:payload].is_a?(SchemaClass::Record)
128
128
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '2.4.0-beta4'
4
+ VERSION = '2.4.0-beta6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0.pre.beta4
4
+ version: 2.4.0.pre.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner