Sha256: 650171223b6fe8871a90657eadfc711e64cf9136f008bc06cef72c6c8e516c22

Contents?: true

Size: 421 Bytes

Versions: 6

Compression:

Stored size: 421 Bytes

Contents

module Tako
  module ActiveRecordExt
    module ConnectionHandling
      def connection
        return Tako::Repository.create_proxy(@force_shard).connection if force_shard?
        if Tako::ProxyStack.top
          Tako::ProxyStack.top.connection
        else
          super
        end
      end
    end
  end
end

ActiveRecord::ConnectionHandling.class_eval do
  prepend Tako::ActiveRecordExt::ConnectionHandling
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tako-0.5.0 lib/tako/active_record_ext/connection_handling.rb
tako-0.4.1 lib/tako/active_record_ext/connection_handling.rb
tako-0.4.0 lib/tako/active_record_ext/connection_handling.rb
tako-0.3.2 lib/tako/active_record_ext/connection_handling.rb
tako-0.3.1 lib/tako/active_record_ext/connection_handling.rb
tako-0.3.0 lib/tako/active_record_ext/connection_handling.rb