Skip to content

Commit

Permalink
don't force a reload of routes when the server first starts
Browse files Browse the repository at this point in the history
this is achieved by only setting up the `to_prepare` block once the
application has finished initializing
  • Loading branch information
seanlinsley committed Feb 17, 2014
1 parent 3661d89 commit d7a2624
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/active_admin/application.rb
Expand Up @@ -239,10 +239,11 @@ def attach_reloader
ActiveAdmin::Engine.config.watchable_dirs[path] = [:rb]
end

app = self
ActionDispatch::Reloader.to_prepare do
app.unload!
Rails.application.reload_routes!
Rails.application.config.after_initialize do
ActionDispatch::Reloader.to_prepare do
ActiveAdmin.application.unload!
Rails.application.reload_routes!
end
end
end
end
Expand Down

0 comments on commit d7a2624

Please sign in to comment.