Skip to content

Commit b59ca78

Browse files
committed
Supported zeitwerk
1 parent 43e4724 commit b59ca78

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

init.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
require 'redmine'
1+
require File.expand_path('../lib/redmine_text_blocks/view_hooks', __FILE__)
22

3-
Rails.configuration.to_prepare do
4-
RedmineTextBlocks.setup
3+
if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled?
4+
Rails.application.config.after_initialize do
5+
RedmineTextBlocks.setup
6+
end
7+
else
8+
Rails.configuration.to_prepare do
9+
RedmineTextBlocks.setup
10+
end
511
end
612

713
Redmine::Plugin.register :redmine_text_blocks do

lib/redmine_text_blocks.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'redmine_text_blocks/view_hooks'
2-
31
module RedmineTextBlocks
42
def self.setup
53
RedmineTextBlocks::ProjectPatch.apply

0 commit comments

Comments
 (0)