Fix not actually connecting to the configured replica (#25977)
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
module DatabaseHelper
|
||||
def with_read_replica(&block)
|
||||
ApplicationRecord.connected_to(role: :read, prevent_writes: true, &block)
|
||||
ApplicationRecord.connected_to(role: :reading, prevent_writes: true, &block)
|
||||
end
|
||||
|
||||
def with_primary(&block)
|
||||
ApplicationRecord.connected_to(role: :primary, &block)
|
||||
ApplicationRecord.connected_to(role: :writing, &block)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,6 +5,8 @@ class ApplicationRecord < ActiveRecord::Base
|
||||
|
||||
include Remotable
|
||||
|
||||
connects_to database: { writing: :primary, reading: :read }
|
||||
|
||||
class << self
|
||||
def update_index(_type_name, *_args, &_block)
|
||||
super if Chewy.enabled?
|
||||
|
||||
Reference in New Issue
Block a user