mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-10-03 17:10:43 -04:00
Add methods to retrieve invoices and estimates for vehicles
This commit is contained in:
1 parent
88b0ffcd6b
commit
8bb98d2408
1 file changed
+10
@@ -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