You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
371 B

8 years ago
  1. if Rails.env.development?
  2. ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Twitter::API'
  3. api_files = Dir[Rails.root.join('app', 'api', '**', '*.rb')]
  4. api_reloader = ActiveSupport::FileUpdateChecker.new(api_files) do
  5. Rails.application.reload_routes!
  6. end
  7. ActionDispatch::Callbacks.to_prepare do
  8. api_reloader.execute_if_updated
  9. end
  10. end