mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Added comments to clearify methods
This commit is contained in:
@@ -26,6 +26,7 @@ class VehiclesController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# search for a vehicle by vin
|
||||||
if params[:search]
|
if params[:search]
|
||||||
@vehicles = Vehicle.search(params[:search]).paginate(:page => params[:page])
|
@vehicles = Vehicle.search(params[:search]).paginate(:page => params[:page])
|
||||||
if only_one_non_zero?(@vehicles)
|
if only_one_non_zero?(@vehicles)
|
||||||
@@ -103,6 +104,8 @@ class VehiclesController < ApplicationController
|
|||||||
|
|
||||||
private
|
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 )
|
def only_one_non_zero?( array )
|
||||||
found_non_zero = false
|
found_non_zero = false
|
||||||
array.each do |val|
|
array.each do |val|
|
||||||
|
|||||||
Reference in New Issue
Block a user