mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-02-13 01:33:58 -05:00
Add methods to retrieve invoices and estimates for vehicles
This commit is contained in:
@@ -71,6 +71,16 @@ class Vehicle < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
self.name = to_s
|
self.name = to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# reurns all invoices for this vehicle
|
||||||
|
def invoices
|
||||||
|
self.issues.flat_map(&:invoices).uniq
|
||||||
|
end
|
||||||
|
|
||||||
|
# returns all estimates for this vehicle
|
||||||
|
def estimates
|
||||||
|
self.issues.flat_map(&:estimate).uniq
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user