Skip to content

Commit f8537e9

Browse files
authored
Merge pull request rails#51776 from Shopify/missing-klass-delegation
Fix `.with_connection` to not set current scope
2 parents 735da84 + 4bd4fcc commit f8537e9

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)