Sha256: ac797d5db7adda1c935dc3ae0c9a47fe1d3ece53bddaf4c8d02af26d544274ce

Contents?: true

Size: 530 Bytes

Versions: 6

Compression:

Stored size: 530 Bytes

Contents

require 'active_support/core_ext/module/delegation'
module ConnectionManager
  module Querying
    delegate :using, :to => (ActiveRecord::VERSION::MAJOR == 4 ? :all : :scoped)
    delegate :slaves, :to => (ActiveRecord::VERSION::MAJOR == 4 ? :all : :scoped)
    delegate :masters, :to => (ActiveRecord::VERSION::MAJOR == 4 ? :all : :scoped)
  end
end
if ActiveRecord::VERSION::MAJOR == 4
  ActiveRecord::Querying.send(:include, ConnectionManager::Querying)
else
  ActiveRecord::Base.send(:extend, ConnectionManager::Querying)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
connection_manager-1.1.5 lib/connection_manager/querying.rb
connection_manager-1.1.4 lib/connection_manager/querying.rb
connection_manager-1.1.3 lib/connection_manager/querying.rb
connection_manager-1.1.2 lib/connection_manager/querying.rb
connection_manager-1.1.1 lib/connection_manager/querying.rb
connection_manager-1.1.0 lib/connection_manager/querying.rb