Contact list for REPP

This commit is contained in:
Martin Lensment 2015-01-08 14:34:33 +02:00
parent 29e35c6452
commit d692088f3b
3 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,11 @@
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