Skip to content

Commit 0bcc437

Browse files
committed
Support zeitwerk
1 parent 156e981 commit 0bcc437

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

init.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
require 'redmine'
1+
require File.expand_path('../lib/redmine_expo_push/hooks', __FILE__)
22

3-
require 'redmine_expo_push'
4-
require 'redmine_expo_push/hooks'
5-
6-
Rails.configuration.to_prepare do
7-
RedmineExpoPush.setup
3+
if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled?
4+
Rails.application.config.after_initialize do
5+
RedmineExpoPush.setup
6+
end
7+
else
8+
require 'redmine_expo_push'
9+
Rails.configuration.to_prepare do
10+
RedmineExpoPush.setup
11+
end
812
end
913

1014
Redmine::Plugin.register :redmine_expo_push do

0 commit comments

Comments
 (0)