Sha256: 920a303cf2e05d8cb1d2c5813a79b17c45a725cdb124d3d0a58d3cb96d209623

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

require "connection_manager/version"

module ConnectionManager
  require 'active_record'
  require 'active_support'
  require 'connection_manager/helpers/abstract_adapter_helper'
  require 'connection_manager/connection_builder'
  require 'connection_manager/helpers/connection_helpers' 
  require 'connection_manager/using'
  require 'connection_manager/shards'  
  require 'connection_manager/replication'
  require 'connection_manager/patches/cross_schema_patch'
  require 'connection_manager/patches/reflections_patch'
  require 'connection_manager/patches/query_methods_patch'
  require 'connection_manager/connection_manager_railtie' if defined?(Rails)
    
  ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include,(ConnectionManager::AbstractAdapterHelper))
  ActiveRecord::Base.extend(ConnectionManager::ConnectionHelpers) 
  ActiveRecord::Base.extend(ConnectionManager::ConnectionBuilder)
  ActiveRecord::Base.send(:include,ConnectionManager::Using)
  ActiveRecord::QueryMethods.send(:include,ConnectionManager::UsingQueryMethod)
  ActiveRecord::Base.extend(ConnectionManager::Replication)
  ActiveRecord::Base.extend(ConnectionManager::Shards)
  
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Base.build_connection_classes
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
connection_manager-1.0.1 lib/connection_manager.rb