Added counter_cache for user jobs, replaced count with size to use cache.

This commit is contained in:
2024-09-17 23:36:45 +02:00
parent 70dd3a0ab8
commit bd58c9d0c6
9 changed files with 31 additions and 26 deletions

View File

@@ -3,7 +3,7 @@
<h3 class="p-3 text-2xl font-bold">
<%= icon(status_icon(status), class: "text-status-#{status} icon icon-nohover") %>
<%= status %>
<span class="block text-3xl text-right"><%= jobs.count %></span>
<span class="block text-3xl text-right"><%= jobs.size %></span>
</h3>
</div>
<% end %>

View File

@@ -2,7 +2,7 @@
<% if jobs.any? %>
<%= button_to icon("printer",
class: "icon icon-nohover size-6 mr-2",
title: "Drucken") + "Nächsten Druckauftrag starten (" + jobs.count.to_s + ")", operator_job_path(jobs.first),
title: "Drucken") + "Nächsten Druckauftrag starten (" + jobs.size.to_s + ")", operator_job_path(jobs.first),
params: { :job => { status: :printing} },
method: :patch,
form_class: "btn bg-green-400 text-black" %>