Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/active_record/turntable/cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def shards_transaction(shards = [], options = {}, in_recursion = false, &block)
end
shard = to_shard(shards.shift)
if shards.present?
shard.connection.transaction(options) do
shard.connection.transaction(**options) do
shards_transaction(shards, options, true, &block)
end
else
shard.connection.transaction(options) do
shard.connection.transaction(**options) do
yield
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_record/turntable/connection_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def cluster

def transaction(options = {}, &block)
with_master {
connection.transaction(options, &block)
connection.transaction(**options, &block)
}
end

Expand Down
4 changes: 2 additions & 2 deletions lib/active_record/turntable/connection_proxy/mixable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module Mixable

def mixable?(method, *args)
(method.to_s =~ METHODS_REGEXP &&
args.first !~ EXCLUDE_QUERY_REGEXP) ||
(method.to_s == "execute" && args.first =~ QUERY_REGEXP)
args.first.to_s !~ EXCLUDE_QUERY_REGEXP) ||
(method.to_s == "execute" && args.first.to_s =~ QUERY_REGEXP)
end
end
end
Expand Down
11 changes: 11 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
require "rubygems"
require "bundler/setup"

# https://www.ruby-lang.org/ja/news/2020/10/02/ruby-2-7-2-released/
# Feature #17000: 2.7.2 turns off deprecation warnings by default
# https://bugs.ruby-lang.org/issues/17000
ruby_version = Gem::Version.create(RUBY_VERSION)
ruby27_version = Gem::Version.create("2.7.2")
if ruby_version >= ruby27_version
if ENV["WARNING"]
Warning[:deprecated] = true
end
end

require "rails"
require "action_view"
require "action_dispatch"
Expand Down