Sha256: c0c663177c510c31ec9ec4159a4c3f5f83985689ca39e85b4b4415f366ed91cd
Contents?: true
Size: 831 Bytes
Versions: 9
Compression:
Stored size: 831 Bytes
Contents
module ActiveRecord::Turntable module ActiveRecordExt module ActsAsArchiveExt def self.prepended(base) class << base prepend ClassMethods end end module ClassMethods # @note use the same shard which `from` shard using def move(config, where, merge_options = {}) if [config[:to], config[:from]].all? { |k| k.try(:turntable_enabled?) } current_shard = config[:from].connection.current_shard.name.to_sym config[:to].connection.with_shard(current_shard) { super } else super end end end end begin require "acts_as_archive" ActsAsArchive.prepend ActsAsArchiveExt rescue LoadError # rubocop:disable Lint/HandleExceptions end end end
Version data entries
9 entries across 9 versions & 1 rubygems