Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/controllers/solid_errors/errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def index

@errors = Error.unresolved
.joins(:occurrences)
.select(errors_table[Arel.star], occurrences_table[:created_at].maximum.as("recent_occurrence"))
.select(errors_table[Arel.star],
occurrences_table[:created_at].maximum.as("recent_occurrence"),
occurrences_table[:id].count.as("occurrences_count"))
.group(errors_table[:id])
.order(recent_occurrence: :desc)
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/solid_errors/errors/_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<pre class="whitespace-pre-wrap ml-6 mt-4"><%= error.message %></pre>
</td>
<td scope="col" class="whitespace-nowrap px-3 py-4 pt-7 text-gray-500 text-right">
<%= error.occurrences.size %>
<%= error.occurrences_count %>
</td>
<td scope="col" class="whitespace-nowrap px-3 py-4 pt-7 text-gray-500 text-right">
<% last_seen_at = error.occurrences.maximum(:created_at) %>
<% last_seen_at = error.recent_occurrence %>
<abbr title="<%= last_seen_at.iso8601 %>" class="cursor-help">
<%= time_tag last_seen_at, time_ago_in_words(last_seen_at, scope: 'datetime.distance_in_words.short') %>
</abbr>
Expand Down