Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Spork Should Auto-reload Models by default #94

apolzon opened this Issue · 3 comments

2 participants


I'm unsure if this is a bug or a feature request, but currently (using Rails3.0.5/Spork0.9.0.rc4), if you want your models reloaded without putting your entire environment load into the Spork.each_run block, you must either use a Sporkfile or manually reload the files (i.e.:
Dir[Rails.root.join("app/models/*/.rb")].each { |f| load f }

It feels like the default should be for models to be reloaded, but if thats counter to the philosophy, feel free to close this issue.


Maybe you can come up with a better implementation, I am open to ideas.

Currently, spork does auto reload models by defualt by preventing them from being preloaded. (And other dev code like controllers). Some plugins cause the model code to be preloaded so some work is required to block that from happening. Spork.trap_method is the weapon of choice usually. There is a wiki article. Can you read it and lemme know what you think?

If you look at the cucumber features , it is the default behavior to reload models and others.

Spork might be too difficult to understand as this is a common gotcha.


No, that all makes sense, missed the trap command, thanks for pointing that out.

@apolzon apolzon closed this

k, great news. If you think of anything that will help newcomers let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.