Skip to content

Commit

Permalink
Fix .with_connection to not set current scope
Browse files Browse the repository at this point in the history
Fix: rails#51775

This us us being bitten by rails#50396
once more. We should really make this delegation much stricter.
  • Loading branch information
byroot committed May 10, 2024
1 parent 735da84 commit 4bd4fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/delegation.rb
Expand Up @@ -100,7 +100,7 @@ def #{method}(...)
:to_sentence, :to_fs, :to_formatted_s, :as_json,
:shuffle, :split, :slice, :index, :rindex, to: :records

delegate :primary_key, :connection, :transaction, to: :klass
delegate :primary_key, :lease_connection, :connection, :with_connection, :transaction, to: :klass

module ClassSpecificRelation # :nodoc:
extend ActiveSupport::Concern
Expand Down

0 comments on commit 4bd4fcc

Please sign in to comment.