Skip to content

Commit 3390b73

Browse files
committed
Added Rails 6 support
1 parent c71e4d9 commit 3390b73

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

init.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717

1818

1919
def init_redmine_dark
20-
Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file|
21-
next unless /\.rb$/ =~ file
22-
require_dependency file
23-
end
20+
require_dependency Rails.root + "plugins/redmine_dark/lib/dark_application_hooks.rb"
2421
end
2522

26-
if Rails::VERSION::MAJOR >= 5
23+
if Rails::VERSION::MAJOR >= 6
24+
Rails.application.config.after_initialize do
25+
init_redmine_dark
26+
end
27+
elsif Rails::VERSION::MAJOR >= 5
2728
ActiveSupport::Reloader.to_prepare do
2829
init_redmine_dark
2930
end

0 commit comments

Comments
 (0)