Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Add support for Redmine 4 / Rails 5 // fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
tofi86 committed Feb 9, 2019
1 parent 359ee28 commit 4bff135
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@
end


# Patches to the Redmine core.
require 'dispatcher' unless Rails::VERSION::MAJOR >= 3
# Patches to the Redmine core.
require 'dispatcher' unless Rails::VERSION::MAJOR >= 3

if Rails::VERSION::MAJOR >= 3
if Rails::VERSION::MAJOR >= 5
ActiveSupport::Reloader.to_prepare do
require_dependency 'application_controller'
AttachmentsController.send(:include, MaintenanceMode)
end
elsif Rails::VERSION::MAJOR >= 3
ActionDispatch::Callbacks.to_prepare do
require_dependency 'application_controller'
ApplicationController.send(:include, MaintenanceMode)
Expand Down
2 changes: 1 addition & 1 deletion lib/maintenance_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def show_maintenance_mode_page
end
end

before_filter(:show_maintenance_mode_page)
before_action(:show_maintenance_mode_page)

end
end
Expand Down

0 comments on commit 4bff135

Please sign in to comment.