A: 

Your problem is that guest.arrived is returning nil.

  • If guest was the nil, then you'd have an error on line 90 saying

    NoMethodError: undefined method `departure=' for nil:NilClass
    
  • If departureDate was nil then you'd get an error on line 91 saying

    NoMethodError: undefined method `-' for nil:NilClass
    

    Besides that, the to_i function used on the first line always returns a number -- even if you got nil or "" from somewere else, nil.to_i and "".to_i both return zero.

  • If the guest.arrived didn't exist, you'd also get a NoMethodError.

Ken Bloom
Hmm I see what you mean. When you put it like that its obvious. But then again Im puzzled, am I "addressing" it wrong then by saying guest.arrived?! As it is in a self method that should be a class method(if u can say that in Ruby). What Im trying to say is that it feels that somehow in between self.check_in and self.check_out Im losing data.
Sebastien
A: 

You already asked this exact same question yesterday and the answer is still the exact same answer: the problem is that the arrived method of guest returns nil and unless you actually show the code of that method, there is nothing anyone can do about it.

Jörg W Mittag
I now posted the checkin method as well hoping thats what you were referring to when you asked about the code. Thank you.
Sebastien