Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

fixing deprecation for Rails 5 #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rails_dev_tweaks/granular_autoload/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def call(env)

# No-op if this is the first request. The initializers take care of that one.
if self.class.processed_a_request? && reload_dependencies?
ActionDispatch::Reloader.cleanup!
ActionDispatch::Reloader.prepare!
Rails.application.reloader.reload!
Rails.application.reloader.prepare!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it just Rails.application.reloader.reload!

Copy link

@imrimt imrimt Dec 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix works for me, including both reload! and prepare!. Of course, since this has not been merged yet so I had to manually change it in the local middleware.rb file. It is important to note that this only works in Rails 5.

end
self.class.processed_a_request = true

Expand Down