Sha256: 43d4d962307d9eda3f93ae9fc208a11589be253b89545e24c703295b4cb68a23

Contents?: true

Size: 775 Bytes

Versions: 40

Compression:

Stored size: 775 Bytes

Contents

module ActiveRecord::Turntable
  class Mixer
    class Fader
      class InsertShardsMergeResult < Fader
        def execute
          if @shards_query_hash.size == 1
            @proxy.shards_transaction(@shards_query_hash.keys) do
              shard, query = @shards_query_hash.first
              shard.connection.send(@called_method, query, *@args, &@block)
            end
          else
            @proxy.shards_transaction(@shards_query_hash.keys) do
              @shards_query_hash.each do |shard, query|
                args    = @args.dup
                args[4] = args[4].dup if args[4].present?
                shard.connection.send(@called_method, query, *args, &@block)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
activerecord-turntable-4.4.1 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-4.4.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-4.3.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-4.2.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-4.1.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-4.0.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-3.1.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-3.0.1 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-3.0.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.5.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-3.0.0.alpha3 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-3.0.0.alpha2 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.4.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-3.0.0.alpha1 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.3.3 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.3.2 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.3.1 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.3.0 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.2.2 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
activerecord-turntable-2.2.1 lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb