Allow to delete answers if the poll has not started yet

Deleting answers was not even possible. But it was possible to delete
questions. So we implemented the same behavior.
This commit is contained in:
Julian Herrero
2022-02-26 17:41:37 +07:00
committed by Javi Martín
parent 3a6e99cb8c
commit 14542df0de
10 changed files with 52 additions and 5 deletions

View File

@@ -9,6 +9,6 @@ class Admin::Poll::Questions::Answers::TableActionsComponent < ApplicationCompon
private
def actions
[:edit].select { |action| can?(action, answer) }
[:edit, :destroy].select { |action| can?(action, answer) }
end
end