Module: Watchtower::WatchedExceptionBase::ClassMethods

Defined in:
lib/watchtower/watched_exception_base.rb

Instance Method Summary collapse

Instance Method Details

#controller_actionsObject



74
75
76
77
78
# File 'lib/watchtower/watched_exception_base.rb', line 74

def controller_actions
  with_exclusive_scope do
    all(:select => "DISTINCT controller_action", :order => "controller_action").collect(&:controller_action)
  end
end

#create_from_exception(controller, exception) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/watchtower/watched_exception_base.rb', line 56

def create_from_exception(controller, exception)
  create! :exception_class  => exception.class.name,
          :controller_name  => controller.controller_name,
          :action_name      => controller.action_name,
          :backtrace        => controller.send(:clean_backtrace, exception).first,
          :request          => controller.request.inspect,
          :parameters       => controller.request.parameters.inspect,
          :format           => controller.request.format.to_s,
          :message          => exception.message.to_s,
          :application_path => ::RAILS_ROOT
end

#exception_classesObject



68
69
70
71
72
# File 'lib/watchtower/watched_exception_base.rb', line 68

def exception_classes
  with_exclusive_scope do
    all(:select => "DISTINCT exception_class", :order => "exception_class").collect(&:exception_class)
  end
end