Streamline archiving-related methods to hide underlying logic related to deletion
The following discussion from !188510 (merged) should be addressed:
-
@rymai started a discussion: observation: We might want to override
#archived?tosuper && !marked_for_deletion?to avoid all these additionalif/unless project.marked_for_deletion?conditions everywhere. It would also hide the logic inside of#archived?instead of forcing developers to know that when a project ismarked_for_deletion?, it's also archived.We should probably also introduce an
#archiving_available?helper method as!project.marked_for_deletion? && can?(current_user, :archive_project, project).
This is how the #archiving_available? method would be used: !188510 (comment 2456030233)
Edited by Rémy Coutable