mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Removed styles & removed after find call
This commit is contained in:
@@ -20,7 +20,7 @@ class Vehicle < ActiveRecord::Base
|
|||||||
validates_presence_of :customer
|
validates_presence_of :customer
|
||||||
validates :vin, uniqueness: true
|
validates :vin, uniqueness: true
|
||||||
before_save :decode_vin
|
before_save :decode_vin
|
||||||
after_find :get_details
|
#after_find :get_details
|
||||||
|
|
||||||
self.primary_key = :id
|
self.primary_key = :id
|
||||||
|
|
||||||
@@ -36,11 +36,13 @@ class Vehicle < ActiveRecord::Base
|
|||||||
|
|
||||||
# returns the raw JSON details from EMUNDS
|
# returns the raw JSON details from EMUNDS
|
||||||
def details
|
def details
|
||||||
|
get_details if @details.nil?
|
||||||
return @details
|
return @details
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns the style of the vehicle
|
# returns the style of the vehicle
|
||||||
def style
|
def style
|
||||||
|
get_details if @details.nil?
|
||||||
begin
|
begin
|
||||||
return @details.trim if @details
|
return @details.trim if @details
|
||||||
rescue
|
rescue
|
||||||
@@ -57,6 +59,7 @@ class Vehicle < ActiveRecord::Base
|
|||||||
|
|
||||||
# returns the number of doors of the vehicle
|
# returns the number of doors of the vehicle
|
||||||
def doors
|
def doors
|
||||||
|
get_details if @details.nil?
|
||||||
return @details.doors if @details
|
return @details.doors if @details
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,6 @@
|
|||||||
<td><%= @vin[0] if @vin %><b><%=@vin[1] if @vin%></b></td>
|
<td><%= @vin[0] if @vin %><b><%=@vin[1] if @vin%></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th>Style</th>
|
|
||||||
<td><%= vehicle.style %></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>Notes</th>
|
<th>Notes</th>
|
||||||
<td><%= vehicle.notes %></td>
|
<td><%= vehicle.notes %></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user