mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-10-03 17:10:43 -04:00
Compact to remove nil elements from the array
This commit is contained in:
1 parent
adcc116841
commit
3efc545f0a
1 file changed
+2
-2
@@ -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