From d0a169151a4a29a8e324098f1c6703865ba5905b Mon Sep 17 00:00:00 2001 From: Alexandru Emil Lupu Date: Fri, 8 Dec 2023 09:26:48 +0200 Subject: [PATCH] Fix controllers --- lib/decidim/custom_proposal_states/engine.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/decidim/custom_proposal_states/engine.rb b/lib/decidim/custom_proposal_states/engine.rb index 2eb1e62..d144074 100644 --- a/lib/decidim/custom_proposal_states/engine.rb +++ b/lib/decidim/custom_proposal_states/engine.rb @@ -54,6 +54,13 @@ class Engine < ::Rails::Engine Decidim::Elections::Admin::ImportProposalsToElections.prepend Decidim::CustomProposalStates::Overrides::ImportProposalsToElections end end + initializer "decidim_custom_proposal_states.action_controller", after: "decidim.action_controller" do + config.to_prepare do + ActiveSupport.on_load :action_controller do + Decidim::Proposals::Admin::ProposalsController.prepend Decidim::CustomProposalStates::Overrides::AdminFilterable + end + end + end initializer "decidim_custom_proposal_states.overrides.proposal" do Rails.application.reloader.to_prepare do @@ -65,9 +72,6 @@ class Engine < ::Rails::Engine Decidim::Proposals::Admin::AnswerProposal.prepend Decidim::CustomProposalStates::Overrides::AnswerProposal Decidim::Proposals::Admin::NotifyProposalAnswer.prepend Decidim::CustomProposalStates::Overrides::NotifyProposalAnswer Decidim::Proposals::Import::ProposalAnswerCreator.prepend Decidim::CustomProposalStates::Overrides::ProposalAnswerCreator - - Decidim::Proposals::Admin::ProposalsController.helper Decidim::LayoutHelper - Decidim::Proposals::Admin::ProposalsController.prepend Decidim::CustomProposalStates::Overrides::AdminFilterable end end end