deimos-ruby 2.3.4 → 2.3.5

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: 50741917506ac69c272492e71217376be5fed3de24cb8695940217d8c466b0a3
4
- data.tar.gz: 87de5660b74dfa13d35ebdf207c0732ca22c569e846d291025936ff6956b99f2
3
+ metadata.gz: 46da6079e98c7833d6ddcd0720173fa0014c8ea86ca7c85759d74c215d0bcd6f
4
+ data.tar.gz: 1397842f6dbe19eb87f6d553ded6aa1ea69e8174e11e0361ec339a8804114802
5
5
  SHA512:
6
- metadata.gz: 114052fbbd43a7b56bac71243399a3ba6d05b3b77e4c4bca73b28f0af0e7cf09647ec095f0cce148371453298525626fccfac5989ba74dd52086e92c8121f0cd
7
- data.tar.gz: 9e45f7fdb1d26f30969a6c3b0142907e6aa8949b11a984eabdefd91e5fc85acac6c338f7706f62711b28f50a71012aee5db97ecceec437472a4c386d7dff38cd
6
+ metadata.gz: d6689bf1cad297f33f58962700a35ec01e7402764755337e6b8ec95acd7418ff9b00f8352ad28935de7c5aca74060a9dd0a421b522ce96037df513429969b3d3
7
+ data.tar.gz: a6bc5d48084d4868fe1de27d54f50781e0c797ed2e56b14cdfa257e968784be5fbca8f221b9ef40de2e79800103f88d42468f197d9759829af6c6eb3426e60d2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## UNRELEASED
9
9
 
10
+ # 2.3.5 - 2026-02-23
11
+
12
+ - Fix: Non-batch consumers should now support string table names.
13
+
10
14
  # 2.3.4 - 2026-02-21
11
15
 
12
16
  - Fix/feature: Send `consumer.lags` and `consumer.lags_delta` metrics via MinimalDatadogListener.
@@ -42,6 +42,7 @@ module Deimos
42
42
  end
43
43
 
44
44
  klass = self.class.config[:record_class]
45
+ klass = klass.constantize if klass.is_a?(String)
45
46
  payload = message.payload
46
47
  if payload.is_a?(Hash) || payload.nil?
47
48
  payload = payload.to_h.with_indifferent_access
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '2.3.4'
4
+ VERSION = '2.3.5'
5
5
  end
@@ -255,6 +255,29 @@ module ActiveRecordConsumerTest
255
255
  expect(Widget.find_by_test_id('id2').some_int).to eq(4)
256
256
  end
257
257
 
258
+ it 'should handle record_class as a string' do
259
+ consumer_class = Class.new(Deimos::ActiveRecordConsumer) do
260
+ record_class 'ActiveRecordConsumerTest::Widget'
261
+ end
262
+ stub_const('MyStringRecordClassConsumer', consumer_class)
263
+ Karafka::App.routes.redraw do
264
+ topic 'my-topic-string' do
265
+ consumer MyStringRecordClassConsumer
266
+ schema 'MySchema'
267
+ namespace 'com.my-namespace'
268
+ key_config plain: true
269
+ end
270
+ end
271
+
272
+ expect(Widget.count).to eq(0)
273
+ test_consume_message(MyStringRecordClassConsumer, {
274
+ test_id: 'abc',
275
+ some_int: 3
276
+ }, call_original: true, key: 5)
277
+ expect(Widget.count).to eq(1)
278
+ expect(Widget.last.test_id).to eq('abc')
279
+ end
280
+
258
281
  it 'should not create record of process_message returns false' do
259
282
  allow_any_instance_of(MyConsumer).to receive(:process_message?).and_return(false)
260
283
  expect(Widget.count).to eq(0)
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.3.4
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner