Added comments to clearify methods

This commit is contained in:
2020-03-28 20:08:44 -04:00
parent d18a9726ac
commit 983811af97

View File

@@ -26,6 +26,7 @@ class VehiclesController < ApplicationController
end
end
# search for a vehicle by vin
if params[:search]
@vehicles = Vehicle.search(params[:search]).paginate(:page => params[:page])
if only_one_non_zero?(@vehicles)
@@ -103,6 +104,8 @@ class VehiclesController < ApplicationController
private
# checks to see if there is only one item in an array
# @return true if array only has one item
def only_one_non_zero?( array )
found_non_zero = false
array.each do |val|