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 +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/deimos/active_record_consume/batch_consumption.rb +8 -9
- data/lib/deimos/utils/schema_class.rb +3 -1
- data/lib/deimos/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c75c30750ad501a4d954681e7ea0c5ddef83c54e313a284d6abb0fde4c059a
|
4
|
+
data.tar.gz: 223a1cf8f77db5d0cb901a00c1a4a1eeb7eb2c9a243e8fa07a5deb32bcac849e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
48
|
-
|
49
|
-
if decoded_key.nil?
|
47
|
+
if key.nil?
|
50
48
|
{}
|
51
|
-
elsif
|
52
|
-
@key_converter.convert(
|
49
|
+
elsif key.is_a?(Hash)
|
50
|
+
@key_converter.convert(key)
|
53
51
|
else
|
54
|
-
{ @klass.primary_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
|
|
data/lib/deimos/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro_turf
|