add a way to delete posts and topics when deleting a user with UserDestroyer

This commit is contained in:
Neil Lalonde
2013-07-24 13:48:55 -04:00
parent a8df9778b5
commit e25638dab0
6 changed files with 87 additions and 49 deletions

View File

@ -150,8 +150,8 @@ class Guardian
user && is_staff?
end
def can_delete_user?(user_to_delete)
can_administer?(user_to_delete) && user_to_delete.post_count <= 0
def can_delete_user?(user)
can_administer?(user)
end
# Can we see who acted on a post in a particular way?