Your problem is that guest.arrived
is returning nil.
If
guest
was thenil
, then you'd have an error on line 90 sayingNoMethodError: undefined method `departure=' for nil:NilClass
If
departureDate
wasnil
then you'd get an error on line 91 sayingNoMethodError: undefined method `-' for nil:NilClass
Besides that, the
to_i
function used on the first line always returns a number -- even if you gotnil
or""
from somewere else,nil.to_i
and"".to_i
both return zero.If the
guest.arrived
didn't exist, you'd also get aNoMethodError
.
Ken Bloom
2010-08-05 15:02:06