From 9d1aa70ad7354ac28bf74770ce0010d551e40835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 4 Jul 2025 08:02:42 +0200 Subject: [PATCH] Rubocop --- .rubocop.yml | 4 ++-- lib/redmine_dmsf/hooks/views/base_view_hooks.rb | 1 + lib/redmine_dmsf/hooks/views/issue_view_hooks.rb | 8 +++----- lib/redmine_dmsf/patches/notifiable_patch.rb | 4 +--- lib/redmine_dmsf/patches/notifiable_ru_patch.rb | 4 +--- lib/redmine_dmsf/patches/puma_patch.rb | 4 +--- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a2a31632..82abac08 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -110,8 +110,8 @@ Rails/SkipsModelValidations: Exclude: - app/helpers/dmsf_upload_helper.rb # touch is Okay - app/models/dmsf_workflow.rb # update doesn't work here - - patches/user_patch.rb - - patches/role_patch.rb + - lib/redmine_dmsf/patches/user_patch.rb + - lib/redmine_dmsf/patches/role_patch.rb - db/migrate/20170526144701_dmsf_attachable.rb - db/migrate/20170421101901_dmsf_file_container_rollback.rb - db/migrate/20170118142001_dmsf_file_container.rb diff --git a/lib/redmine_dmsf/hooks/views/base_view_hooks.rb b/lib/redmine_dmsf/hooks/views/base_view_hooks.rb index 7b6e9b43..b442f561 100644 --- a/lib/redmine_dmsf/hooks/views/base_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/base_view_hooks.rb @@ -28,6 +28,7 @@ module RedmineDmsf ) return end + context[:controller].send :render_to_string, { partial: 'hooks/redmine_dmsf/view_layouts_base_html_head' } end end diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb index f21a8903..159c1ec7 100644 --- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb @@ -93,8 +93,8 @@ module RedmineDmsf end def view_issues_edit_notes_bottom_style(context = {}) - if ((User.current.pref.dmsf_attachments_upload_choice == 'Attachments') || - !allowed_to_attach_documents(context[:container])) + if User.current.pref.dmsf_attachments_upload_choice == 'Attachments' || + !allowed_to_attach_documents(context[:container]) '' else 'display: none' @@ -150,9 +150,7 @@ module RedmineDmsf return unless allowed_to_attach_documents(container) html = +'' if label html << "" diff --git a/lib/redmine_dmsf/patches/notifiable_patch.rb b/lib/redmine_dmsf/patches/notifiable_patch.rb index e96b12e0..b8e4bf4d 100644 --- a/lib/redmine_dmsf/patches/notifiable_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_patch.rb @@ -42,6 +42,4 @@ module RedmineDmsf end # Apply the patch -unless RedmineDmsf::Plugin.an_obsolete_plugin_present? - Redmine::Notifiable.prepend RedmineDmsf::Patches::NotifiablePatch -end +Redmine::Notifiable.prepend RedmineDmsf::Patches::NotifiablePatch unless RedmineDmsf::Plugin.an_obsolete_plugin_present? diff --git a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb index cda24969..63f67677 100644 --- a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb @@ -46,6 +46,4 @@ module RedmineDmsf end # Apply the patch -if RedmineDmsf::Plugin.an_obsolete_plugin_present? - Redmine::Notifiable.include RedmineDmsf::Patches::NotifiableRuPatch -end +Redmine::Notifiable.include RedmineDmsf::Patches::NotifiableRuPatch if RedmineDmsf::Plugin.an_obsolete_plugin_present? diff --git a/lib/redmine_dmsf/patches/puma_patch.rb b/lib/redmine_dmsf/patches/puma_patch.rb index ae99ac49..46966d56 100644 --- a/lib/redmine_dmsf/patches/puma_patch.rb +++ b/lib/redmine_dmsf/patches/puma_patch.rb @@ -39,6 +39,4 @@ module RedmineDmsf end # Apply the patch -if RedmineDmsf::Plugin.lib_available?('puma/const') - Puma::Const.include RedmineDmsf::Patches::PumaPatch -end +Puma::Const.include RedmineDmsf::Patches::PumaPatch if RedmineDmsf::Plugin.lib_available?('puma/const')