fixed pool deletion logic
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user