Compact to remove nil elements from the array

This commit is contained in:
2026-01-31 12:55:47 -05:00
parent adcc116841
commit 3efc545f0a

View File

@@ -74,12 +74,12 @@ class Vehicle < ActiveRecord::Base
# reurns all invoices for this vehicle
def invoices
self.issues.flat_map(&:invoices).uniq
self.issues.flat_map(&:invoices).uniq.compact
end
# returns all estimates for this vehicle
def estimates
self.issues.flat_map(&:estimate).uniq
self.issues.flat_map(&:estimate).uniq.compact
end
private