mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update vehicle.rb
This commit is contained in:
@@ -12,16 +12,15 @@ class Vehicle < ActiveRecord::Base
|
|||||||
|
|
||||||
unloadable
|
unloadable
|
||||||
belongs_to :customer
|
belongs_to :customer
|
||||||
|
attr_accessible :year, :make, :model, :customer, :notes, :vin
|
||||||
attr_accessible :year, :make, :model, :customer_id, :notes, :vin
|
validates_presence_of :customer
|
||||||
validates_presence_of :customer_id
|
|
||||||
validates :vin, uniqueness: true
|
validates :vin, uniqueness: true
|
||||||
before_save :decode_vin
|
before_save :decode_vin
|
||||||
after_initialize :get_details
|
after_initialize :get_details
|
||||||
|
|
||||||
# returns a human readable string
|
# returns a human readable string
|
||||||
def to_s
|
def to_s
|
||||||
return "#{self.year} #{self.make} #{self.model}"
|
return "#{self.customer.name} - #{self.year} #{self.make} #{self.model}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns the raw JSON details from EMUNDS
|
# returns the raw JSON details from EMUNDS
|
||||||
|
|||||||
Reference in New Issue
Block a user