GRN2-247: Added Active Pending Banned Deleted tabs to manage users (#816)

* Added Active Pending Banned Deleted tabs to manage users

* Removed hard coded strings

* Fixed issues with sign in flow

* Fixed issues with rooms not deleting
This commit is contained in:
Ahmad Farhat
2019-10-10 16:10:23 -04:00
committed by Jesus Federico
parent 03bde37a2b
commit 49def8f405
22 changed files with 411 additions and 70 deletions

View File

@ -26,20 +26,28 @@ module Deleteable
scope :deleted, -> { include_deleted.where(deleted: true) }
end
def destroy
run_callbacks :destroy
update_attribute(:deleted, true)
def destroy(permanent = false)
if permanent
super()
else
run_callbacks :destroy do end
update_attribute(:deleted, true)
end
end
def delete
destroy
end
def undelete
assign_attributes(deleted: false)
def delete(permanent = false)
destroy(permanent)
end
def undelete!
update_attribute(:deleted, false)
end
def permanent_delete
destroy(true)
end
def deleted?
deleted
end
end