Module: Methadone::Rails::Helpers

Defined in:
lib/methadone/rails/helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(k) ⇒ Object



4
5
6
# File 'lib/methadone/rails/helpers.rb', line 4

def self.included(k)
  setup_rails_logger
end

Instance Method Details

#disable_active_record_loggingObject



18
19
20
# File 'lib/methadone/rails/helpers.rb', line 18

def disable_active_record_logging
  ActiveRecord::Base.logger.level = 1
end

#enable_active_record_loggingObject



14
15
16
# File 'lib/methadone/rails/helpers.rb', line 14

def enable_active_record_logging
  ActiveRecord::Base.logger.level = 0
end

#setup_rails_loggerObject



8
9
10
11
12
# File 'lib/methadone/rails/helpers.rb', line 8

def setup_rails_logger
  Rails.logger = Logger.new(STDOUT)
  disable_active_record_logging
  change_logger Rails.logger
end