gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/config/initializers/reload_api.rb

14 lines
371 B
Ruby
Raw Normal View History

2016-02-20 22:53:20 +01:00
if Rails.env.development?
ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Twitter::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