From 54de15db0bbff03e7f33f1d730bb7a6a2b99754d Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Sun, 12 Apr 2020 15:49:13 +0200 Subject: [PATCH] Patch integration cleanups --- lib/redmine_messenger/patches/contact_patch.rb | 13 +++++++------ lib/redmine_messenger/patches/db_entry_patch.rb | 13 +++++++------ lib/redmine_messenger/patches/issue_patch.rb | 13 +++++++------ lib/redmine_messenger/patches/password_patch.rb | 13 +++++++------ lib/redmine_messenger/patches/wiki_page_patch.rb | 13 +++++++------ 5 files changed, 35 insertions(+), 30 deletions(-) diff --git a/lib/redmine_messenger/patches/contact_patch.rb b/lib/redmine_messenger/patches/contact_patch.rb index c19b181..ff6dc7a 100644 --- a/lib/redmine_messenger/patches/contact_patch.rb +++ b/lib/redmine_messenger/patches/contact_patch.rb @@ -1,12 +1,13 @@ module RedmineMessenger module Patches module ContactPatch - def self.included(base) - base.include InstanceMethods - base.class_eval do - after_create_commit :send_messenger_create - after_update_commit :send_messenger_update - end + extend ActiveSupport::Concern + + included do + include InstanceMethods + + after_create_commit :send_messenger_create + after_update_commit :send_messenger_update end module InstanceMethods diff --git a/lib/redmine_messenger/patches/db_entry_patch.rb b/lib/redmine_messenger/patches/db_entry_patch.rb index 0d47798..af3e1d2 100644 --- a/lib/redmine_messenger/patches/db_entry_patch.rb +++ b/lib/redmine_messenger/patches/db_entry_patch.rb @@ -1,12 +1,13 @@ module RedmineMessenger module Patches module DbEntryPatch - def self.included(base) - base.include InstanceMethods - base.class_eval do - after_create_commit :send_messenger_create - after_update_commit :send_messenger_update - end + extend ActiveSupport::Concern + + included do + include InstanceMethods + + after_create_commit :send_messenger_create + after_update_commit :send_messenger_update end module InstanceMethods diff --git a/lib/redmine_messenger/patches/issue_patch.rb b/lib/redmine_messenger/patches/issue_patch.rb index 5010ad1..4b87d50 100644 --- a/lib/redmine_messenger/patches/issue_patch.rb +++ b/lib/redmine_messenger/patches/issue_patch.rb @@ -1,12 +1,13 @@ module RedmineMessenger module Patches module IssuePatch - def self.included(base) - base.include InstanceMethods - base.class_eval do - after_create_commit :send_messenger_create - after_update_commit :send_messenger_update - end + extend ActiveSupport::Concern + + included do + include InstanceMethods + + after_create_commit :send_messenger_create + after_update_commit :send_messenger_update end module InstanceMethods diff --git a/lib/redmine_messenger/patches/password_patch.rb b/lib/redmine_messenger/patches/password_patch.rb index 94cdeae..f4878f1 100644 --- a/lib/redmine_messenger/patches/password_patch.rb +++ b/lib/redmine_messenger/patches/password_patch.rb @@ -1,12 +1,13 @@ module RedmineMessenger module Patches module PasswordPatch - def self.included(base) - base.include InstanceMethods - base.class_eval do - after_create_commit :send_messenger_create - after_update_commit :send_messenger_update - end + extend ActiveSupport::Concern + + included do + include InstanceMethods + + after_create_commit :send_messenger_create + after_update_commit :send_messenger_update end module InstanceMethods diff --git a/lib/redmine_messenger/patches/wiki_page_patch.rb b/lib/redmine_messenger/patches/wiki_page_patch.rb index c104fcd..56b0faa 100644 --- a/lib/redmine_messenger/patches/wiki_page_patch.rb +++ b/lib/redmine_messenger/patches/wiki_page_patch.rb @@ -1,12 +1,13 @@ module RedmineMessenger module Patches module WikiPagePatch - def self.included(base) - base.include InstanceMethods - base.class_eval do - after_create_commit :send_messenger_create - after_update_commit :send_messenger_update - end + extend ActiveSupport::Concern + + included do + include InstanceMethods + + after_create_commit :send_messenger_create + after_update_commit :send_messenger_update end module InstanceMethods