Sha256: 617a7574a029f24c3592b81ee69e024c9b2794486b7e738294968b759e7d95c2
Contents?: true
Size: 647 Bytes
Versions: 73
Compression:
Stored size: 647 Bytes
Contents
module Arql::Commands module ShowSql class << self def show return if Arql::App.log_io.is_a?(Arql::MultiIO) && Arql::App.log_io.include?(STDOUT) Arql::App.log_io ||= Arql::MultiIO.new ActiveRecord::Base.logger = Logger.new(Arql::App.log_io) Arql::App.log_io << STDOUT end def hide return if !Arql::App.log_io.is_a?(Arql::MultiIO) || !Arql::App.log_io.include?(STDOUT) Arql::App.log_io.delete(STDOUT) end end Pry.commands.block_command 'show-sql' do ShowSql.show end Pry.commands.block_command 'hide-sql' do ShowSql.hide end end end
Version data entries
73 entries across 73 versions & 1 rubygems