Ruby on Rails Sunday, February 7, 2016

Walter Davis wrote in post #1181250:
>> self.username
>> end
>
> This method is going to return the username, which is probably set to
> something, and that means true when you ask this way. You probably meant
> to check if the admin attribute on that user model.
>
> Walter

I have a is_admin column on my users table. Set to false by default. How
can I use it alongside the method? I will manually set true of course
for specified users.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5ee273b72a7e0a22822eb39c488ffd77%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment