messaging 4.0.4.pre → 4.0.6

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: f76dc35b493eb944a479e329a474a7489fe8f343e5e0cb61b4becd1b584386c5
4
- data.tar.gz: d8ae5780117ac2b18a0fc30fa02e2801eb0b19db0cd92c4d3548099c1814e8f0
3
+ metadata.gz: 453b65c49cebcc69c61734174427b71bfcb5f8a7a2a3e95accede52187c20d7e
4
+ data.tar.gz: 8fc1ca7183766a39ed816a5cdd20951158d1b374f50f1be37048894d4a208869
5
5
  SHA512:
6
- metadata.gz: b767a34378a64ef4ff9065b45665fafa3a66322d82c410b218683949dc0536466be365e842b341ff83c8a32a564d4c05ae3b3971a1fb453800c46052320a8e4c
7
- data.tar.gz: a38d74910ce0f4ed0decd9b59108f80b821058626f58fae043afdbb597f93bd96dafe375a9d94ea2f826c6e665012fa409ed245051265d16d039836f32875f9c
6
+ metadata.gz: ae7f4188feebdfbcd9751389f4935cff0642211733c7413647d978aa8bf68fbc2efaa6024ae68a6988214e394de00e16c22f09784fd0b4026e21a2ffdc4f1915
7
+ data.tar.gz: 838050ea4683a816eb080cca3f6595159d4da2a345a9e9fea8b5ac58b69d4e9010eef71f7a74b2cd863ccdcab01a51dd6e3238ea812f9d80548effb28e3fba29
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- messaging (4.0.4.pre)
4
+ messaging (4.0.6)
5
5
  activerecord
6
6
  activesupport
7
7
  after_transaction
@@ -72,6 +72,7 @@ module Messaging
72
72
  return super if readonly?
73
73
  with_locked_stream do
74
74
  set_stream_position
75
+ set_transaction_id
75
76
  validate_expected_version!
76
77
  super
77
78
  end
@@ -88,6 +89,10 @@ module Messaging
88
89
  self.stream_position = current_stream_position + 1
89
90
  end
90
91
 
92
+ def set_transaction_id
93
+ self.transaction_id = self.class.connection.select_value('SELECT pg_current_xact_id()')
94
+ end
95
+
91
96
  def validate_expected_version!
92
97
  ExpectedVersion.new(expected_version || :any).match!(current_stream_position)
93
98
  end
@@ -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.4.pre'.freeze
2
+ VERSION = '4.0.6'.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.4.pre
4
+ version: 4.0.6
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