Sha256: 6c66cfae53156ac1a4e7531d99e6d6d231f894d0e3c21c977efc2b1d29422c52

Contents?: true

Size: 697 Bytes

Versions: 22

Compression:

Stored size: 697 Bytes

Contents

begin
  require 'acts_as_archive'
  # acts_as_archive extension
  class ActsAsArchive
    class << self
      # @note use the same shard which `from` shard using
      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

22 entries across 22 versions & 1 rubygems

Version Path
activerecord-turntable-2.5.0 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.4.0 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.3.3 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.3.2 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.3.1 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.3.0 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.2.2 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.2.1 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.2.0 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.1.1 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.1.0 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.1.0.rc2 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.1.0.rc1 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.1.0.beta2 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.1.0.beta1 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.0.6 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.0.5 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.0.4 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.0.3 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb
activerecord-turntable-2.0.2 lib/active_record/turntable/active_record_ext/acts_as_archive_extension.rb