Skip to content

Instantly share code, notes, and snippets.

@rsanheim
Created June 29, 2011 15:23
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rsanheim/1054078 to your computer and use it in GitHub Desktop.
Save rsanheim/1054078 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/timcharper/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
@skrobul
Copy link

skrobul commented Jan 20, 2014

works with Rails 4 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment