list issues in desc order

This commit is contained in:
2022-02-21 19:33:38 -05:00
parent 1344526f7f
commit 440c8e4618
3 changed files with 6 additions and 9 deletions

View File

@@ -62,6 +62,8 @@ class VehiclesController < ApplicationController
begin
@vehicle = Vehicle.find_by_id(params[:id])
@vin = @vehicle.vin.scan(/.{1,9}/) if @vehicle.vin
@issues = @vehicle.issues.order(id: :desc)
@closed_issues = (@issues - @issues.open)
rescue ActiveRecord::RecordNotFound
render_404
end