Sha256: d5b2c0468bf387429839d3227e96ead4683c7011fba195ee6dbd64d602b3aa39

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require 'active_record'
require 'expeditor'
require 'activerecord/shard_for/version'
require 'activerecord/shard_for/config'
require 'activerecord/shard_for/cluster_config'
require 'activerecord/shard_for/model'
require 'activerecord/shard_for/errors'
require 'activerecord/shard_for/connection_router'
require 'activerecord/shard_for/hash_modulo_router'
require 'activerecord/shard_for/distkey_router'
require 'activerecord/shard_for/database_tasks'
require 'activerecord/shard_for/shard_repogitory'
require 'activerecord/shard_for/all_shards_in_parallel'
require 'activerecord/shard_for/replication_mapping'
require 'activerecord/railtie' if defined?(Rails5)

module ActiveRecord
  module ShardFor
    class << self
      # @return [Activerecord::ShardFor::Config]
      def config
        @config ||= Config.new
      end

      # @yield [Activerecord::ShardFor::Config]
      def configure(&block)
        config.instance_eval(&block)
      end
    end
  end
end

ActiveRecord::ShardFor.configure do |config|
  config.register_connection_router(:hash_modulo, ActiveRecord::ShardFor::HashModuloRouter)
  config.register_connection_router(:distkey, ActiveRecord::ShardFor::DistkeyRouter)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-shard_for-0.2.0 lib/activerecord/shard_for.rb