Add load_and_authorize_resource to answers controller

This commit is contained in:
taitus
2022-09-09 16:29:04 +02:00
parent 405b37f605
commit cb2958e1b0
3 changed files with 7 additions and 4 deletions

View File

@@ -3,10 +3,10 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
include DocumentAttributes
load_and_authorize_resource :question, class: "::Poll::Question"
load_resource class: "::Poll::Question::Answer",
through: :question,
through_association: :question_answers,
except: :documents
load_and_authorize_resource class: "::Poll::Question::Answer",
through: :question,
through_association: :question_answers,
except: :documents
def new
end