Displaying 2 results from an estimated 2 matches for "accepts_role".
2006 Jul 11
0
Should I use exclamation marks for methods that change associations?
I''ve been getting some good feedback on the Authorization plugin
(http://www.writertopia.com/developers/authorization). Josh Susser
suggested I use exclamation marks when I''m setting roles. The basic
ways of setting roles uses the #has_role, #has_no_role, #accepts_role,
and #accepts_no_role methods:
user.has_role ''site_admin''
user.has_role ''moderator'', group
user.has_no_role ''site_admin''
user.has_role ''member'', Group
a_model.accepts_role ''mode...
2010 Jan 25
9
skinny Controllers, fat models with REST?
...btask = true
end
end
if ( ( (@authorized == false ) && (@addsubtask == false) ) ||
( (@authorized == true ) && (@addsubtask == true) ) )
respond_to do |format|
if(@task.priority == nil)
@task.priority = Priority.find(2)
end
@task.accepts_role ''Owner'', current_user
if @task.save
#Task an
if @addsubtask
@task.move_to_child_of(@task.parent_id)
end
@task.recalculate_progress_recursive
flash[:notice] = ''Task was successfully created.''...