Skip to content

Commit 4bd4fcc

Browse files
committed
Fix .with_connection to not set current scope
Fix: rails#51775 This us us being bitten by rails#50396 once more. We should really make this delegation much stricter.
1 parent 735da84 commit 4bd4fcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/relation/delegation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def #{method}(...)
100100
:to_sentence, :to_fs, :to_formatted_s, :as_json,
101101
:shuffle, :split, :slice, :index, :rindex, to: :records
102102

103-
delegate :primary_key, :connection, :transaction, to: :klass
103+
delegate :primary_key, :lease_connection, :connection, :with_connection, :transaction, to: :klass
104104

105105
module ClassSpecificRelation # :nodoc:
106106
extend ActiveSupport::Concern

0 commit comments

Comments
 (0)