class ActiveRecordShards::ConnectionSwitcher::MasterSlaveProxy

Public Class Methods

new(target, which) click to toggle source
# File lib/active_record_shards/connection_switcher.rb, line 215
def initialize(target, which)
  @target = target
  @which = which
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
# File lib/active_record_shards/connection_switcher.rb, line 220
def method_missing(method, *args, &block) # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
  @target.on_primary_or_replica(@which) { @target.send(method, *args, &block) }
end