# Questions about changes to Restful Authentication

**URL:** <https://www.ruby-forum.com/t/questions-about-changes-to-restful-authentication/152365>\
**Category:** Rails\
**Created:** [November 3, 2008, 6:02am UTC](https://www.ruby-forum.com/t/questions-about-changes-to-restful-authentication/152365 "2008-11-03T06:02:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [November 3, 2008, 6:02am UTC](https://www.ruby-forum.com/t/questions-about-changes-to-restful-authentication/152365/1 "2008-11-03T06:02:50Z")

</div>

I have a couple of projects with Restful Authentication

The first snippet is from the Git repo today and is supposed to be the  
newer code.

```
# Store the given user id in the session.
def current_user=(new_user)
  session[:user_id] = new_user ? new_user.id : nil
  @current_user = new_user || false
end

```

# Store the given user id in the session.

def current\_user=(new\_user)  
session[:user\_id] = (new\_user.nil? || new\_user.is\_a?(Symbol)) ?  
nil : new\_user.id  
@current\_user = new\_user || :false  
end

Why did “@current\_user = new\_user || :false” become false? and how  
did :false work at all.  
Why did we stop caring that new\_user is a Symbol? and how could that  
happen anyway.

Both are somewhat hypothetical questions, but I am curious.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [November 3, 2008, 5:34pm UTC](https://www.ruby-forum.com/t/questions-about-changes-to-restful-authentication/152365/2 "2008-11-03T17:34:51Z")

</div>

To answer this you would need to look at the other code surrounding  
current\_user, but a more direct answer is that using the symbol :false  
would not represent a boolean false.

You would need to dig deeper into the code to figure out why they did  
not want an actual boolean false. My guess is that it was a hack that  
they have since been able to implement in a cleaner way allowing them to  
use an actual boolean false value.

In any case it’s an internal implementation so either way should not  
affect your public use of their API (assuming you’re not hacking around  
their API).

Ruby F. wrote:

> I have a couple of projects with Restful Authentication
> 
> # Store the given user id in the session.
> 
> def current\_user=(new\_user)  
> session[:user\_id] = (new\_user.nil? || new\_user.is\_a?(Symbol)) ?  
> nil : new\_user.id  
> @current\_user = new\_user || :false  
> end
