mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-02-13 09:34:00 -05:00
Compact to remove nil elements from the array
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user