Sha256: 267be8fb2bdd30f7ba822e2965b7dd95fcc36ac5d0826d93caf8934baeb2719e

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

module Arql::Commands
  module Reconnect
    class << self
      def reconnect
        Arql::SSHProxy.reconnect
        ActiveRecord::Base.connection.reconnect! unless ActiveRecord::Base.connection.active?
      end

      def reconnect!
        Arql::SSHProxy.reconnect!
        ActiveRecord::Base.connection.reconnect!
      end
    end

    Pry.commands.block_command 'reconnect' do
      Reconnect.reconnect
    end

    Pry.commands.block_command 'reconnect!' do
      Reconnect.reconnect!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arql-0.1.23 lib/arql/commands/reconnect.rb