lib/sapience/rails.rb in sapience-0.2.11 vs lib/sapience/rails.rb in sapience-0.2.12
- old
+ new
@@ -1,11 +1,11 @@
require "sapience"
-require "sapience/extensions/action_controller/live"
+require "sapience/extensions/action_controller/live" if defined?(ActionController::Live)
require "sapience/extensions/action_controller/log_subscriber"
require "sapience/extensions/action_dispatch/debug_exceptions"
require "sapience/extensions/action_view/streaming_template_renderer"
-require "sapience/extensions/active_record/log_subscriber"
+require "sapience/extensions/active_record/log_subscriber" if defined?(ActiveRecord)
require "sapience/extensions/rails/rack/logger"
require "sapience/extensions/rails/rack/logger_info_as_debug"
require "sapience/extensions/action_view/log_subscriber"
module Sapience
@@ -62,10 +62,10 @@
require "sapience/extensions/active_job/logging" if defined?(ActiveJob)
# Replace the Bugsnag logger
Bugsnag.configure { |config| config.logger = Sapience[Bugsnag] } if defined?(Bugsnag)
Sapience::Extensions::ActionController::LogSubscriber.attach_to :action_controller
# Sapience::Extensions::ActiveSupport::MailerLogSubscriber.attach_to :action_mailer
- Sapience::Extensions::ActiveRecord::LogSubscriber.attach_to :active_record
+ Sapience::Extensions::ActiveRecord::LogSubscriber.attach_to :active_record if defined?(ActiveRecord)
Sapience::Extensions::ActionView::LogSubscriber.attach_to :action_view
# Sapience::Extensions::ActiveJob::LogSubscriber.attach_to :active_job
end
end
end