From 16e40a8db46fc872d2159158bc7081d6829affcb Mon Sep 17 00:00:00 2001 From: Burak Ikiler Date: Tue, 21 May 2024 14:40:39 +0530 Subject: [PATCH] Add missing Rails.configuration.to_prepare Co-authored-by: Jigarius --- init.rb | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/init.rb b/init.rb index b272f592..80c38396 100644 --- a/init.rb +++ b/init.rb @@ -1,22 +1,26 @@ # frozen_string_literal: true -require_relative 'lib/toggl_2_redmine' +Rails.configuration.to_prepare do + require_relative 'lib/toggl_2_redmine' -Redmine::Plugin.register :toggl2redmine do - # Package info. - name 'Toggl 2 Redmine' - author 'Jigar Mehta' - description 'Imports time entries from Toggl into Redmine.' - version Toggl2Redmine::VERSION - url 'https://github.com/jigarius/toggl2redmine' - author_url 'https://jigarius.com/' + Redmine::Plugin.register :toggl2redmine do + # Package info. + name 'Toggl 2 Redmine' + author 'Jigarius' + description 'Imports time entries from Toggl into Redmine.' + version Toggl2Redmine::VERSION + url 'https://github.com/jigarius/toggl2redmine' + author_url 'https://jigarius.com/' - # Menu items. - menu :application_menu, - :toggl2redmine, - { controller: 't2r_import', action: 'index' }, - caption: 'Toggl' -end + # Menu items. + menu :application_menu, + :toggl2redmine, + { controller: 't2r_import', action: 'index' }, + caption: 'Toggl' + end -# Patches. -require 'patches/time_entry' + Rails.configuration.to_prepare do + # Patches. + require 'patches/time_entry_patch' + end +end