railstutorial/sample_app

Reposting tiny bug from getsatisfaction page

Closed this issue · 2 comments

cqfd commented

Hey, this is alan.m.odonnell from the getsatisfaction page. I think my post about the #current_user= self stuff was kind of unclear, so here's a gist with some code illustrating what I was trying to say.

http://gist.github.com/637811

I've just added a couple lines to #sign_in and #sign_out from the SessionsHelper module that raise an exception unless @current_user is set correctly after calling "current_user = user" and "current_user = nil". Hopefully this is a little clearer!

On my system, neither raise line raises an exception, as long as the current_user= method is defined as in the tutorial.

cqfd commented

Huh, that's really interesting--I'm really baffled why our systems would behave differently. Oh well, thanks again!