Update vehicles_controller.rb

This commit is contained in:
ricky authored and GitHub committed 2016-08-01 19:31:51 -04:00
1 parent d9ccffe3d6
commit e201765f02
1 file changed
+13
+13
View File
@@ -91,5 +91,18 @@ class VehiclesController < ApplicationController
render_404 render_404
end end
end end
private
def only_one_non_zero?( array )
found_non_zero = false
array.each do |val|
if val!=0
return false if found_non_zero
found_non_zero = true
end
end
found_non_zero
end
end end