brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.64k stars 114 forks source link

Documentation add-on: autoload paths #70

Closed mediafinger closed 10 years ago

mediafinger commented 10 years ago

Under Rails 4.1.1 I had to add app/jobs to my autoload paths, to make the sucker_punch jobs available:

config/application.rb config.autoload_paths += %W(#{config.root}/app/jobs)

brandonhilkert commented 10 years ago

This is generally not need as folders under the app directory are autoloaded. They may not be eager loaded, which could be the issue here. Do you have a sample Rails app publicly available? And what is the behavior happening that makes it not work?

mediafinger commented 10 years ago

Hi Brandon,

I would love to point you to the failing app. But I encountered the issue while teaching and live coding (were quite awkward ten minutes :sweat_drops:). Some SO article suggested this fix and it worked for me in the moment - I got rid of the NameError: uninitialized constant error and could proceed with what I wanted to show to the class.

But with the code I have in the repo, I am unable to reproduce this behaviour...

So, thanks for your quick response (and offering this gem)! :smiley: