deimos-ruby 1.14.1 → 1.14.4

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: 1d94fcbeb955de22fde06b29f63809cae7305d91f029ba8ec0b36e4dbbe037a2
4
- data.tar.gz: 611e5cc68a5d9e661ff692f05692d7ba24e4804f5761479802a632cbdd2a0fd7
3
+ metadata.gz: 81c75c30750ad501a4d954681e7ea0c5ddef83c54e313a284d6abb0fde4c059a
4
+ data.tar.gz: 223a1cf8f77db5d0cb901a00c1a4a1eeb7eb2c9a243e8fa07a5deb32bcac849e
5
5
  SHA512:
6
- metadata.gz: 5100b19ede901f0b7a4e20f0aa6c15d487e9355d95ea46d984c8fcb587039be4be9529991197148e630ad3670c65d79ab0653ff57c28e224236a4d966bebe7e1
7
- data.tar.gz: '082ad2e7be4d85fa3e8e242cdc7f192a35f99424675f5bddc3e11a3c19477ce5abf0df629117ca4f714ca107ea5be0a93a8aa5041a1f67cc628517f451005bb1'
6
+ metadata.gz: 95605e56b2852137a1645fa3497903d138045cdcf51902c4cad29321e78d0626f2ceb439789db46b69cb08f305f580efa804c768c9a781c0f96e677e4cf2f340
7
+ data.tar.gz: 4375d5c1bdde5b53598a1a11910615fda36d69e1dd92650becf710dd312425f07521fa70e0bebe4567e1d9931b5f70e71654f3dc0c74685141cb945193019672
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## UNRELEASED
9
9
 
10
+ # 1.14.4 - 2022-06-18
11
+
12
+ - Fix import in ActiveRecordConsumer on mysql
13
+
14
+ # 1.14.3 - 2022-06-17
15
+
16
+ - Fix issue with ActiveRecordConsumer double-decoding keys in batch mode.
17
+
18
+ # 1.14.2 - 2022-05-26
19
+
20
+ - Fix crash with `test_consume_message` when passing in an instance of a schema class instead of a hash.
21
+
10
22
  # 1.14.1 - 2022-05-25
11
23
 
12
24
  - Fix: When using key schemas, ActiveRecordConsumers were not finding the record by default.
@@ -44,14 +44,12 @@ module Deimos
44
44
  # @param key [String] The encoded key.
45
45
  # @return [Hash] The key attributes.
46
46
  def record_key(key)
47
- decoded_key = decode_key(key)
48
-
49
- if decoded_key.nil?
47
+ if key.nil?
50
48
  {}
51
- elsif decoded_key.is_a?(Hash)
52
- @key_converter.convert(decoded_key)
49
+ elsif key.is_a?(Hash)
50
+ @key_converter.convert(key)
53
51
  else
54
- { @klass.primary_key => decoded_key }
52
+ { @klass.primary_key => key }
55
53
  end
56
54
  end
57
55
 
@@ -102,12 +100,13 @@ module Deimos
102
100
 
103
101
  options = if key_cols.empty?
104
102
  {} # Can't upsert with no key, just do regular insert
103
+ elsif ActiveRecord::Base.connection.adapter_name.downcase =~ /mysql/
104
+ {
105
+ on_duplicate_key_update: :all
106
+ }
105
107
  else
106
108
  {
107
109
  on_duplicate_key_update: {
108
- # conflict_target must explicitly list the columns for
109
- # Postgres and SQLite. Not required for MySQL, but this
110
- # ensures consistent behaviour.
111
110
  conflict_target: key_cols,
112
111
  columns: :all
113
112
  }
@@ -6,10 +6,12 @@ module Deimos
6
6
  module SchemaClass
7
7
  class << self
8
8
  # Converts a raw payload into an instance of the Schema Class
9
- # @param payload [Hash]
9
+ # @param payload [Hash, Deimos::SchemaClass::Base]
10
10
  # @param schema [String]
11
11
  # @return [Deimos::SchemaClass::Record]
12
12
  def instance(payload, schema)
13
+ return payload if payload.is_a?(Deimos::SchemaClass::Base)
14
+
13
15
  klass = "Schemas::#{schema.underscore.camelize}".safe_constantize
14
16
  return payload if klass.nil? || payload.nil?
15
17
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.14.1'
4
+ VERSION = '1.14.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-25 00:00:00.000000000 Z
11
+ date: 2022-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro_turf