I wanted to use Sidekiq instead of Resque to handle my background jobs.
After normal changes I had lots of this kind of errors:
NoMethodError: undefined method `find' for #<User:0x00000003c8ea08>
NameError: uninitialized constant User
It was a requirement problem. I required everything with autoload, which is not thread-safe. - and deprecated-. I've changed for require.
Instead of
autoload :User, 'model/useer'
i use
require root_path + '/app/models/User.rb'
And no more error :)
Aucun commentaire:
Enregistrer un commentaire