Patch integration cleanups

This commit is contained in:
Alexander Meindl
2020-04-12 09:35:10 +02:00
parent 8519130cee
commit 294f435452
6 changed files with 7 additions and 15 deletions

12
init.rb
View File

@@ -1,7 +1,5 @@
raise "\n\033[31mredmine_messenger requires ruby 2.3 or newer. Please update your ruby version.\033[0m" if RUBY_VERSION < '2.3'
require_dependency 'redmine_messenger'
Redmine::Plugin.register :redmine_messenger do
name 'Redmine Messenger'
author 'AlphaNodes GmbH'
@@ -41,12 +39,6 @@ Redmine::Plugin.register :redmine_messenger do
}, partial: 'settings/messenger_settings'
end
begin
if ActiveRecord::Base.connection.table_exists?(Setting.table_name)
Rails.configuration.to_prepare do
RedmineMessenger.setup
end
end
rescue ActiveRecord::NoDatabaseError
Rails.logger.error 'database not created yet'
Rails.configuration.to_prepare do
RedmineMessenger.setup
end

View File

@@ -2,7 +2,7 @@ module RedmineMessenger
module Patches
module ContactPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.include InstanceMethods
base.class_eval do
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update

View File

@@ -2,7 +2,7 @@ module RedmineMessenger
module Patches
module DbEntryPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.include InstanceMethods
base.class_eval do
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update

View File

@@ -2,7 +2,7 @@ module RedmineMessenger
module Patches
module IssuePatch
def self.included(base)
base.send(:include, InstanceMethods)
base.include InstanceMethods
base.class_eval do
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update

View File

@@ -2,7 +2,7 @@ module RedmineMessenger
module Patches
module PasswordPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.include InstanceMethods
base.class_eval do
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update

View File

@@ -2,7 +2,7 @@ module RedmineMessenger
module Patches
module WikiPagePatch
def self.included(base)
base.send(:include, InstanceMethods)
base.include InstanceMethods
base.class_eval do
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update