sequel-activerecord_connection 1.4.0 → 1.4.2

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: 94acb3799fdbf874ddad7c419bba8e39c75e09a4e59c724e28a69249fe434e35
4
- data.tar.gz: 1ad5e5b556427804e682dc6948626c557a89e62030ad8b9ee2827905dea245fe
3
+ metadata.gz: 98f7c003a3446727d0ff140e37f9965b2088dbb95c43fb58e84aeeaab2f9f85e
4
+ data.tar.gz: aba6068cf2804cbec9434cde909218c2b40b33fcb3b68dafe815a168125cb761
5
5
  SHA512:
6
- metadata.gz: 876b0d32959a6263e2e6ac7309bdab3833fd07e0778ec1b5437abd8a61417b32fe7034e8473c916accae59e34f2bb64ce3e875a180d0abadfccc6c5725a98a51
7
- data.tar.gz: b32f9486f8a3452e5c99fd5aa28dfdb6322a788267dc4307c76a8d2d01b83070de62aed105c91b41d3620a112d36d630dd114e383330bb0701430a167f32d901
6
+ metadata.gz: cca4d6b635c771444e656ab8231fd8a17c5a4da49b2a10d52ec640cf94c18ded25864dc72e293b6e7b5a6088c2d401df5d66dc2ba94d750bc975c9f5365601b2
7
+ data.tar.gz: b54b06b0bd97316856d690ec0ce4ebedcb9cf90664966e46ef6cf3d5c4ed56595b19f5bd10df666de388ea0426248add5c39f28489f93e2a766b1def6385e412
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 1.4.2 (2024-09-23)
2
+
3
+ * Fix compatibility with newer versions of Oracle Enhanced adapter (@janko)
4
+
5
+ * Drop support for Ruby 2.4 (@janko)
6
+
7
+ ## 1.4.1 (2024-05-10)
8
+
9
+ * Fix `#rollback_checker`, `#rollback_on_exit` and `#after_rollback` not working reliably on JRuby and Sequel 5.78+ (@janko)
10
+
11
+ * Use native transaction callbacks on Active Record 7.2+ (@janko)
12
+
1
13
  ## 1.4.0 (2024-03-19)
2
14
 
3
15
  * Only warn when Sequel extension fails to initialize because there is no database (@janko)
@@ -5,10 +5,12 @@ module Sequel
5
5
  module Oracle
6
6
  def synchronize(*)
7
7
  super do |conn|
8
+ raw_connection = conn.respond_to?(:raw_oci_connection) ? conn.raw_oci_connection : conn
9
+
8
10
  # required for prepared statements
9
- Utils.add_prepared_statements_cache(conn.raw_oci_connection)
11
+ Utils.add_prepared_statements_cache(raw_connection)
10
12
 
11
- yield conn.raw_oci_connection
13
+ yield raw_connection
12
14
  end
13
15
  end
14
16
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "after_commit_everywhere"
4
-
5
3
  module Sequel
6
4
  module ActiveRecordConnection
7
5
  Error = Class.new(Sequel::Error)
@@ -16,6 +14,7 @@ module Sequel
16
14
  def self.extended(db)
17
15
  db.activerecord_model = ActiveRecord::Base
18
16
  db.opts[:test] = false unless db.opts.key?(:test)
17
+ db.instance_variable_set(:@transactions, {}) if RUBY_ENGINE == "jruby"
19
18
 
20
19
  begin
21
20
  require "sequel/extensions/activerecord_connection/#{db.adapter_scheme}"
@@ -120,7 +119,7 @@ module Sequel
120
119
  # after_commit_everywhere gem.
121
120
  def add_transaction_hook(conn, type, block)
122
121
  if _trans(conn)[:activerecord]
123
- AfterCommitEverywhere.public_send(type, &block)
122
+ activerecord_transaction_callback(type, &block)
124
123
  else
125
124
  super
126
125
  end
@@ -132,12 +131,24 @@ module Sequel
132
131
  # after_commit_everywhere gem.
133
132
  def add_savepoint_hook(conn, type, block)
134
133
  if _trans(conn)[:savepoints].last[:activerecord]
135
- AfterCommitEverywhere.public_send(type, &block)
134
+ activerecord_transaction_callback(type, &block)
136
135
  else
137
136
  super
138
137
  end
139
138
  end
140
139
 
140
+ if ActiveRecord.version >= Gem::Version.new("7.2.0")
141
+ def activerecord_transaction_callback(type, &block)
142
+ activerecord_connection.current_transaction.public_send(type, &block)
143
+ end
144
+ else
145
+ require "after_commit_everywhere"
146
+
147
+ def activerecord_transaction_callback(type, &block)
148
+ AfterCommitEverywhere.public_send(type, &block)
149
+ end
150
+ end
151
+
141
152
  # Prevents sql_log_normalizer DB extension from skipping the normalization.
142
153
  def skip_logging?
143
154
  return false if @loaded_extensions.include?(:sql_log_normalizer)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "sequel-activerecord_connection"
3
- spec.version = "1.4.0"
3
+ spec.version = "1.4.2"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko.marohnic@gmail.com"]
6
6
 
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.homepage = "https://github.com/janko/sequel-activerecord_connection"
10
10
  spec.license = "MIT"
11
11
 
12
- spec.required_ruby_version = ">= 2.4"
12
+ spec.required_ruby_version = ">= 2.5"
13
13
 
14
14
  spec.add_dependency "sequel", "~> 5.38"
15
15
  spec.add_dependency "activerecord", ">= 5.0", "< 8"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-activerecord_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-19 00:00:00.000000000 Z
11
+ date: 2024-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -131,14 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: '2.4'
134
+ version: '2.5'
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.5.3
141
+ rubygems_version: 3.5.11
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Allows Sequel to use ActiveRecord connection for database interaction.