lib/effective_logging/engine.rb in effective_logging-3.0.8 vs lib/effective_logging/engine.rb in effective_logging-3.0.9

- old
+ new

@@ -1,22 +1,23 @@ require 'effective_logging/active_record_logger' +require 'effective_logging/email_logger' +require 'effective_logging/log_page_views' +require 'effective_logging/set_current_user' +require 'effective_logging/user_logger' module EffectiveLogging class Engine < ::Rails::Engine engine_name 'effective_logging' - config.autoload_paths += Dir["#{config.root}/lib/"] - # Set up our default configuration options. initializer "effective_logging.defaults", :before => :load_config_initializers do |app| eval File.read("#{config.root}/config/effective_logging.rb") end # Automatically Log Emails initializer 'effective_logging.emails' do |app| if EffectiveLogging.email_enabled == true - require 'effective_logging/email_logger' ActionMailer::Base.register_interceptor(EffectiveLogging::EmailLogger) end end # Include acts_as_loggable concern and allow any ActiveRecord object to call it with log_changes() @@ -28,10 +29,9 @@ # Register the log_page_views concern so that it can be called in ActionController or elsewhere initializer 'effective_logging.log_changes_action_controller' do |app| Rails.application.config.to_prepare do ActiveSupport.on_load :action_controller do - require 'effective_logging/set_current_user' ActionController::Base.include(EffectiveLogging::SetCurrentUser::ActionController) end end end