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.
This commit is contained in:
Javi Martín
2023-07-01 21:20:29 +02:00
parent 3e2da29443
commit 9d74f06d24

View File

@@ -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