[Admin] Allow searching by exception class

This commit is contained in:
Earlopain 2024-02-27 15:52:38 +01:00
parent 2d7e507555
commit 4acddd5941
No known key found for this signature in database
GPG Key ID: 48860312319ADF61
2 changed files with 11 additions and 6 deletions

View File

@ -42,12 +42,16 @@ class ExceptionLog < ApplicationRecord
def self.search(params)
q = super
if params[:version].present?
q = q.where(version: params[:version])
if params[:commit].present?
q = q.where(version: params[:commit])
end
if params[:without_timeouts]&.truthy?
q = q.where("class_name != 'ActiveRecord::QueryCanceled'")
if params[:class_name].present?
q = q.where(class_name: params[:class_name])
end
if params[:without_class_name].present?
q = q.where.not(class_name: params[:without_class_name])
end
q.apply_basic_order(params)

View File

@ -1,6 +1,7 @@
<%= form_search(path: admin_exceptions_path) do |f| %>
<%= f.input :version, label: "Commit" %>
<%= f.input :without_timeouts, as: :boolean %>
<%= f.input :commit %>
<%= f.input :class_name %>
<%= f.input :without_class_name %>
<% end %>
<table class="striped">