messaging 4.0.5 → 4.0.7

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: c87e653e527433818875b3b98f39b57e96e0ad4d6d6768af9c447c889bc6a023
4
- data.tar.gz: 1d9022a5ad433b724394abee582ae61c136ca4f2b800251d9a475570189b6e4a
3
+ metadata.gz: 8d97703c43540975f23e063202772870e7439b03fb6c235a62542db64a59c903
4
+ data.tar.gz: 4e8a8fc4b255ef40d46faf78e2b632a16b8b2005ff6ee3738f338337fcf2dae5
5
5
  SHA512:
6
- metadata.gz: 231eb2da912229c56f3fefd8b57b7d2a314ef86d554430a17228b3d94da64100fd8580f1b7f30541e51cd8d787d09b48f0c891a71e7ecee545cbaadbc9957c38
7
- data.tar.gz: c8f73a2c7495625c0e2e37c419358b72cf49495cf4ecaa3442c9c550905534d0d16554bfe9480e15128b135d99012bd727a9917ab3fc0e26b0982a61c9faaaff
6
+ metadata.gz: fca2269ac7b7fa8bb3ab12231dd54c1bfb860d0fa24b9a9eaf616e5a5e58f36c256d838653f26d0019070d27e8082c9a0a638d0012976a4d1c4f014ca210fcf8
7
+ data.tar.gz: db69ec7bdf8757fc37bae8f450bfa4652dfe3456d18568e33495d4e6e6a1dfe381ef562ec041c4de6bc41df9e32acaf890b5c408da3c5c61216298b234abaf8e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- messaging (4.0.5)
4
+ messaging (4.0.7)
5
5
  activerecord
6
6
  activesupport
7
7
  after_transaction
@@ -30,7 +30,10 @@ module Messaging
30
30
  # Rails version < 6
31
31
  def self.instantiate(attributes, *_args)
32
32
  attributes['message_type'].constantize.new(
33
- JSON.parse(attributes['data']).merge(stream_position: attributes['stream_position'])
33
+ JSON.parse(attributes['data']).merge(
34
+ stream_position: attributes['stream_position'],
35
+ transaction_id: attributes['transaction_id'],
36
+ global_position: attributes['id'])
34
37
  )
35
38
  end
36
39
 
@@ -90,7 +93,7 @@ module Messaging
90
93
  end
91
94
 
92
95
  def set_transaction_id
93
- self.transaction_id = connection.select_value('SELECT pg_current_xact_id()')
96
+ self.transaction_id = self.class.connection.select_value('SELECT pg_current_xact_id()')
94
97
  end
95
98
 
96
99
  def validate_expected_version!
@@ -0,0 +1,11 @@
1
+ module Messaging
2
+ module Rails
3
+ module PostgresXid8Type
4
+ def initialize_type_map(m = type_map)
5
+ m.register_type('xid8', ActiveRecord::Type::String.new)
6
+
7
+ super
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,6 +1,7 @@
1
1
  require 'rails/railtie'
2
2
  require 'messaging/middleware/after_active_record_transaction'
3
3
  require 'messaging/middleware/rails_wrapper'
4
+ require 'messaging/rails/postgres_xid8_type'
4
5
 
5
6
  module Messaging
6
7
  module Rails
@@ -32,6 +33,10 @@ module Messaging
32
33
  end
33
34
  end
34
35
 
36
+ initializer 'messaging.add_xid_type' do |_|
37
+ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Messaging::Rails::PostgresXid8Type)
38
+ end
39
+
35
40
  config.to_prepare do
36
41
  Messaging.routes.finalize_routes
37
42
  end
@@ -1,3 +1,3 @@
1
1
  module Messaging
2
- VERSION = '4.0.5'.freeze
2
+ VERSION = '4.0.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bukowskis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-04 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -315,6 +315,7 @@ files:
315
315
  - lib/messaging/middleware/after_active_record_transaction.rb
316
316
  - lib/messaging/middleware/rails_wrapper.rb
317
317
  - lib/messaging/publish.rb
318
+ - lib/messaging/rails/postgres_xid8_type.rb
318
319
  - lib/messaging/rails/railtie.rb
319
320
  - lib/messaging/resque_worker.rb
320
321
  - lib/messaging/routes.rb