Permalink
Browse files

Removing context from project works properly now

  • Loading branch information...
1 parent 94fd929 commit 99d4998b3e1cf202201a6dd9c7938550336f62a1 @skalnik skalnik committed Jun 28, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 app/controllers/memberships_controller.rb
View
7 app/controllers/memberships_controller.rb
@@ -11,7 +11,12 @@ def create
end
def update
- @membership.update_attributes(params[:membership]) unless params[:membership][:context_name].empty?
+ if params[:membership][:context_name].empty?
+ @membership.context = nil
+ @membership.save!
+ else
+ @membership.update_attributes(params[:membership])
+ end
respond_to do |format|
format.html { redirect_to project_path(@project)}
end

0 comments on commit 99d4998

Please sign in to comment.