Skip to content

Use spork

Steven Chanin edited this page · 3 revisions

ActiveAdmin loads all the registered models when the routes are loaded. This prevents Spork from loading changes before each run.

To fix this, you can delay route loading:

Spork.prefork do
  require "rails/application"
  Spork.trap_method(Rails::Application, :reload_routes!) # Rails 3.0
  Spork.trap_method(Rails::Application::RoutesReloader, :reload!) # Rails 3.1 or 3.2

  require File.dirname(__FILE__) + "/../config/environment.rb"
Something went wrong with that request. Please try again.