Skip to content

Rails 5.1 support #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/require_reloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def watch(gem_name, opts={})

# based on Tim Cardenas's solution:
# http://timcardenas.com/automatically-reload-gems-in-rails-327-on-eve
ActionDispatch::Callbacks.to_prepare do
helper.to_prepare do
if opts[:module_name]
helper.remove_module_if_defined(opts[:module_name])
else
Expand Down
7 changes: 7 additions & 0 deletions lib/require_reloader/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def camelcase(str)
str.split("_").map{|token| token.capitalize }.join("")
end

def to_prepare(&block)
if Rails::VERSION::MAJOR == 5
ActiveSupport::Reloader.to_prepare(&block)
else
ActionDispatch::Callbacks.to_prepare(&block)
end
end
end

end
1 change: 0 additions & 1 deletion test/resources/progress_bar
Submodule progress_bar deleted from 81c086