Delayed_job not saving in database

By : evoo

I am using Ruby on Rails and trying to add a feature for scheduling notification push by using delayed job. I implemented the gem as per documentation and started workers by running rake jobs:work but despite my best efforts, no job is being saved. I tried Delayed::Job.all in the console but it returns an empty array no matter what I do.

my model:

class MessageSocialAccount < ActiveRecord::Base
  attr_accessible :social_account_id, :message_id, :read_time, :push_notification
  attr_reader :when_to_run
  belongs_to :message
  belongs_to :social_account

  def when_to_run
    message.deliver_at ||

  def push
    update_attributes!(:push_notification => true)
  handle_asynchronously :push, :run_at => {|i| i.when_to_run }

I can see no delayed_job.log in the logs and development.log does not contain any clues.

Would you have any ideas what the problem might be? Thanks

*EDIT the model that I am calling it from: message.rb

class Message < ActiveRecord::Base
  def send_push_to_all(delivery_time=nil){|msg_sca| msg_sca.push} unless self.reward.status=="qa"
    self.update_attributes!(:sent_at =>

The call comes from the controller:

By : evoo


I realised that the app I was working on had already implemented Sidekiq for another purpose and looks like those 2 interfered. When the Sidekiq interface was opened I could see the jobs in there eventhough they were not showing in the delayed job queries.

By : evoo

This video can help you solving your question :)
By: admin