From 00a8817472575bf8ae9af78a2a5cfab7b0f1d1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Mon, 30 Dec 2024 10:54:58 +0100 Subject: [PATCH] Zeitwerk --- patches/easy_crm_case_patch.rb | 2 +- patches/easy_crm_cases_controller_patch.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/easy_crm_case_patch.rb b/patches/easy_crm_case_patch.rb index 15b7595f..46215637 100644 --- a/patches/easy_crm_case_patch.rb +++ b/patches/easy_crm_case_patch.rb @@ -158,7 +158,7 @@ def journalize_dmsf_file(dmsf_file, added_or_removed) end # Apply the patch -if Redmine::Plugin.installed?('easy_crm') +if defined?(EasyPatchManager) EasyPatchManager.register_model_patch 'EasyCrmCase', 'RedmineDmsf::Patches::EasyCrmCasePatch', if: -> { EasyPluginLoader.plugin_active? 'easy_crm_2_0' } end diff --git a/patches/easy_crm_cases_controller_patch.rb b/patches/easy_crm_cases_controller_patch.rb index 8179582d..9dbc2242 100644 --- a/patches/easy_crm_cases_controller_patch.rb +++ b/patches/easy_crm_cases_controller_patch.rb @@ -122,8 +122,9 @@ def controller_easy_crm_cases_before_save end # Apply the patch -if Redmine::Plugin.installed?('easy_crm') +if defined?(EasyPatchManager) EasyPatchManager.register_controller_patch 'EasyCrmCasesController', 'RedmineDmsf::Patches::EasyCrmCasesControllerPatch', - prepend: true + prepend: true, + if: -> { Redmine::Plugin.installed? 'easy_crm_2_0' } end