Remove unneeded code

This doesn't seem to affect anything.
Removes deprecation message when used with Rails 5.0.

DEPRECATION WARNING: to_prepare is deprecated and will be removed from Rails 5.1 (use ActiveSupport::Reloader.to_prepare instead) (called from <top (required)> at /media/sf_registry/config/initializers/reload_api.rb:8)
This commit is contained in:
Artur Beljajev 2019-10-31 14:21:02 +02:00
parent 6fb8767aef
commit a76ab87d21

View file

@ -1,11 +0,0 @@
if Rails.env.development?
ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Repp::API'
api_files = Dir[Rails.root.join('app', 'api', '**', '*.rb')]
api_reloader = ActiveSupport::FileUpdateChecker.new(api_files) do
Rails.application.reload_routes!
end
ActionDispatch::Callbacks.to_prepare do
api_reloader.execute_if_updated
end
end