From 9d74f06d24df0ff87140060745e852f03eb0a4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 21:20:29 +0200 Subject: [PATCH] Simplify loading resources in DraftVersionsController We were using `prepend: true`, but it doesn't seem to be necessary. We were also loading the draft versions twice in the index, so we can remove the line loading them a second time. --- .../admin/legislation/draft_versions_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/legislation/draft_versions_controller.rb b/app/controllers/admin/legislation/draft_versions_controller.rb index 21704a70e..5cb6fc88e 100644 --- a/app/controllers/admin/legislation/draft_versions_controller.rb +++ b/app/controllers/admin/legislation/draft_versions_controller.rb @@ -1,11 +1,10 @@ class Admin::Legislation::DraftVersionsController < Admin::Legislation::BaseController include Translatable - load_and_authorize_resource :draft_version, class: "Legislation::DraftVersion", through: :process, prepend: true - load_and_authorize_resource :process, class: "Legislation::Process", prepend: true + load_and_authorize_resource :process, class: "Legislation::Process" + load_and_authorize_resource :draft_version, class: "Legislation::DraftVersion", through: :process def index - @draft_versions = @process.draft_versions end def create