fixed pool deletion logic

This commit is contained in:
albert
2012-03-15 18:26:39 -04:00
parent 1736ed17a9
commit 779d83e253
7 changed files with 48 additions and 8 deletions

View File

@@ -49,10 +49,19 @@ class PoolsController < ApplicationController
if !@pool.deletable_by?(CurrentUser.user)
raise User::PrivilegeError
end
@pool.destroy
@pool.update_attribute(:is_deleted, true)
respond_with(@pool, :notice => "Pool deleted")
end
def undelete
@pool = Pool.find(params[:id])
if !@pool.deletable_by?(CurrentUser.user)
raise User::PrivilegeError
end
@pool.update_attribute(:is_deleted, false)
respond_with(@pool, :notice => "Pool undeleted")
end
def revert
@pool = Pool.find(params[:id])
@version = PoolVersion.find(params[:version_id])