I am using the following code to check if a variable is not nil and not zero
if(discount != nil && discount != 0) ... end
Is the
I believe the following is good enough for ruby code. I don't think I could write a unit test that shows any difference between this and the original.
if discount != 0 end