lib/arql/commands/reconnect.rb in arql-0.1.22 vs lib/arql/commands/reconnect.rb in arql-0.1.23

- old
+ new

@@ -1,13 +1,23 @@ 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