2013-01-17 15:35:57 +00:00
|
|
|
module Projects
|
|
|
|
class UpdateContext < BaseContext
|
|
|
|
def execute(role = :default)
|
2013-03-25 08:48:30 +00:00
|
|
|
params[:project].delete(:namespace_id)
|
2013-01-17 15:35:57 +00:00
|
|
|
params[:project].delete(:public) unless can?(current_user, :change_public_mode, project)
|
|
|
|
project.update_attributes(params[:project], as: role)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|