Don't allow changing answers if the poll has started

Just like we did with questions.
This commit is contained in:
Julian Herrero
2022-02-26 17:41:37 +07:00
committed by Javi Martín
parent 7a812a82e2
commit 3a6e99cb8c
9 changed files with 183 additions and 29 deletions

View File

@@ -0,0 +1,14 @@
class Admin::Poll::Questions::Answers::TableActionsComponent < ApplicationComponent
attr_reader :answer
delegate :can?, to: :helpers
def initialize(answer)
@answer = answer
end
private
def actions
[:edit].select { |action| can?(action, answer) }
end
end