Hy all, I'm having a really hard time trying to create an observer for delayed_job. I want to create a job watcher that will inform the different accounts that there are tasks running on back ground.
class DelayedJobObserver < ActiveRecord::Observer
job_watcher = JobWatcher.find_by_job_id job.id
Whenever I try to call DelayedJobObserver.observed_class, it keeps throwing:
LoadError: Expected ~/MY_APP/vendor/plugins/delayed_job/lib/delayed_job.rb to define DelayedJob
I guess it's the model class name out of standard that is causing it. Any hints?
In order to succeed with my intent I have changed the model a little bit, by renaming the delayed_jobs table to simply jobs. I do understand that it won't be easy to rename it to jobs (because there might have some apps already using this table name), but it respects more the rails code conventions. Alternatively, it's possible to rename Jobs class and change table name to a mode convenient name.
I'm closing this issue because I rewrote with the old table name and it's working. I've checked on git and I just can't figure out where I had messed up the code.
Yea i think this is because of rails reloading.