Module: Coalmine::Rails

Defined in:
lib/coalmine/rails.rb,
lib/coalmine/rails/action_controller.rb,
lib/coalmine/rails/controller_methods.rb

Defined Under Namespace

Modules: ActionController, ControllerMethods

Class Method Summary collapse

Class Method Details

.initObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/coalmine/rails.rb', line 9

def self.init
  
  if defined? ::ActionController::Base
    Rails.logger.debug "Enhancing ActionController::Base with Coalmine goodies."
    ::ActionController::Base.send(:include, Coalmine::Rails::ActionController)
  end
  
  # Add to configuration
  Coalmine.configure do |config|
    config.logger = Rails.logger
    config.environment = Rails.env
    config.project_root = Rails.root
    config.framework = "Rails: #{::Rails::VERSION::STRING}" if defined? ::RAILS::VERSION
  end
end