search for: is_administr

Displaying 2 results from an estimated 2 matches for "is_administr".

2006 Feb 23
13
Check if a saved user''s name is admin
Hi all, I have a question about this method in my User model: # Returns true for the (saved) user called "admin" def is_the_administrator true if save and name == "admin" end The method returns true if the user''s name is admin. However, I only want to return true if the state of the object is "saved", so I call the save method first. I''m
2006 Jul 11
0
Should I use exclamation marks for methods that change associations?
...s_no_role ''moderator'', user Model.accepts_role ''class moderator'', user With the new dynamic methods, we give the user-like model some flexibility: user.is_moderator_of group --> sets user to have role "moderator" for object group. user.is_administrator --> sets user to have role "administrator" not really tied to any object. user.is_eligible_for award --> sets user to have role "eligible" for object award. In the discussions I''ve read on proper use of exclamation marks, some say it should only be u...