Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1578 - Adds a unique destroy? policy for file version membership #1591

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

jlandiseigsti
Copy link
Contributor

closes #1578

The fileVersionMembershipPolicy used to just delegate to the destroy policy of the WorkVersionPolicy. However, we want a slight change – while we don't want to be able to delete the non-recent work versions, we want to be able to delete files even if they are associated with older versions.

The fileVersionMembershipPolicy used to just delegate to the destroy policy
of the WorkVersionPolicy. However, we want a slight change – while we don't want
to be able to delete the non-recent work versions, we want to be able to delete files
even if they are associated with older versions.
Copy link
Contributor

@ajkiessl ajkiessl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I did notice that the flash message set in the controller for deleting a file is 'Work version was successfully destroyed'. Since we're making changes in the area, we might as well fix this to say something like 'File was successfully destroyed'.

authorize(@file_version)
@file_version.destroy
respond_to do |format|
format.html do
redirect_to dashboard_form_files_path(@work_version),
notice: 'Work version was successfully destroyed.'
end
format.json { head :no_content }
end

Copy link
Contributor

@ajkiessl ajkiessl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jlandiseigsti jlandiseigsti merged commit 63f4bd2 into main Sep 23, 2024
1 check passed
@jlandiseigsti jlandiseigsti deleted the 1578-work-version-delete branch September 23, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow deletion of file for non-latest WorkVersions
2 participants