From ddf03d42972b1326ed3478d339cf5f03f700e8ad Mon Sep 17 00:00:00 2001 From: Dominic Cleal Date: Wed, 26 Apr 2017 08:09:45 +0100 Subject: [PATCH] Use AD::Reloader on Rails 4, app.reloader only on Rails 5+ Fixes #539 --- lib/apipie/application.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apipie/application.rb b/lib/apipie/application.rb index 422efc60..c70b6722 100644 --- a/lib/apipie/application.rb +++ b/lib/apipie/application.rb @@ -424,10 +424,10 @@ def ignored?(controller, method = nil) # as this would break loading of the controllers. def rails_mark_classes_for_reload unless Rails.application.config.cache_classes - Rails.application.reloader.reload! + Rails::VERSION::MAJOR == 4 ? ActionDispatch::Reloader.cleanup! : Rails.application.reloader.reload! init_env reload_examples - Rails.application.reloader.prepare! + Rails::VERSION::MAJOR == 4 ? ActionDispatch::Reloader.prepare! : Rails.application.reloader.prepare! end end