Sha256: 9bb0639e0f00dfab7d9a8b9fe057d40595a5b85290ace8298f6c5e17b34b4961

Contents?: true

Size: 912 Bytes

Versions: 6

Compression:

Stored size: 912 Bytes

Contents

# -*- coding: utf-8 -*-
module ActiveRecord::Turntable
  class Mixer
    class Fader
      extend ActiveSupport::Autoload

      eager_autoload do
        # single shard
        autoload :SpecifiedShard
        # multiple shard merging
        autoload :SelectShardsMergeResult
        autoload :InsertShardsMergeResult
        autoload :UpdateShardsMergeResult
        # calculations
        autoload :CalculateShardsSumResult
      end

      attr_reader :shards_query_hash
      attr_reader :called_method
      attr_reader :query

      def initialize(proxy, shards_query_hash, called_method, query, *args, &block)
        @proxy = proxy
        @shards_query_hash = shards_query_hash
        @called_method = called_method
        @query = query
        @args = args
        @block = block
      end

      def execute
        raise NotImplementedError, "Called abstract method"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord-turntable-4.4.1 lib/active_record/turntable/mixer/fader.rb
activerecord-turntable-4.4.0 lib/active_record/turntable/mixer/fader.rb
activerecord-turntable-4.3.0 lib/active_record/turntable/mixer/fader.rb
activerecord-turntable-4.2.0 lib/active_record/turntable/mixer/fader.rb
activerecord-turntable-4.1.0 lib/active_record/turntable/mixer/fader.rb
activerecord-turntable-4.0.0 lib/active_record/turntable/mixer/fader.rb