Add fallback for last service date and introduce 'unknown' label

This commit is contained in:
ricky committed 2026-08-08 14:30:11 -04:00
1 parent bdfad0d020
commit 7158a8b02c
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@
<% mileage = last.custom_values.find_by(custom_field_id: CustomField.find_by_name("Mileage").id) %>
<% if mileage %>
<p>
<b><%=t(:label_last_service) %></b> <%= last.closed_on.to_date %>
<b><%=t(:label_last_service) %></b> <%= last&.closed_on&.to_date || l(:label_unknown) %>
at <%= mileage.value %>
<%=t(:label_miles) %>
</p>