Sha256: 3dfd196fb63a5ccddd4e329fa68c2ca9d4f8c441fafee8063c32dcf485299acd

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

begin
  require 'acts_as_archive'

  class ActsAsArchive
    class << self
      def move_with_turntable(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) {
            move_without_turntable(config, where, merge_options)
          }
        else
          move_without_turntable(config, where, merge_options)
        end
      end

      alias_method_chain :move, :turntable
    end
  end
rescue LoadError
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-turntable-2.0.0.rc1 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb