Skip to content

Instantly share code, notes, and snippets.

@niklas
Forked from rsanheim/gist:1054078
Created November 7, 2011 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niklas/1344547 to your computer and use it in GitHub Desktop.
Save niklas/1344547 to your computer and use it in GitHub Desktop.
Devise + Spork + Rails 3.1 RC4 hacks to keep User model from loading prefork
Spork.prefork do
require "rails/application"
# Prevent Devise from loading the User model super early with it's route hacks for Rails 3.1 rc4
# see also: https://github.com/sporkrb/spork/wiki/Spork.trap_method-Jujutsu
Spork.trap_method(Rails::Application, :reload_routes!)
Spork.trap_method(Rails::Application::RoutesReloader, :reload!)
# rest of your prefork here...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment