I've been playing with this setting and have run into a bit of a gotcha.
tl;dr - models don't load in rake tasks/migrations - do this: config.threadsafe! unless $rails_rake_task or explicitly require the model.
The dependency_loading = false setting in the threadsafe! method means that you won't have access to your models in migrations or rake tasks (ie. db:seed).
I've been playing with this setting and have run into a bit of a gotcha.
tl;dr - models don't load in rake tasks/migrations - do this:
config.threadsafe! unless $rails_rake_task
or explicitly require the model.The
dependency_loading = false
setting in thethreadsafe!
method means that you won't have access to your models in migrations or rake tasks (ie. db:seed).It's described here this old rails issue and discussed in this article.