title: delayed_job. Delete job from queue
body: <pre><code>class Radar
   include Mongoid::Document
   after_save :post_on_facebook
  
   private
  
   def post_on_facebook
    if self.user.settings.post_facebook
      Delayed::Job.enqueue(::FacebookJob.new(self.user,self.body,url,self.title),0,self.active_from)
    end
   end
  
  end
  
  class FacebookJob &lt; Struct.new(:user,:body,:url,:title)
    include SocialPluginsHelper
  
    def perform
      facebook_client(user).publish_feed('', :message =&gt; body, :link =&gt; url, :name =&gt; title)
    end
  end
  </code></pre>
  
  <p>I want execute post_on_facebook method at specific date. I store this date at "active_from" field.</p>
  
  <p>Code above is working and job is executed at correct date.</p>
  
  <p>But in some cases I first create Radar object and send some job to Delayed Job queue. After that I update this object and send another job to Delayed Job.</p>
  
  <p>This is wrong behavior because I wan't execute job only once at correct time. In this implementation I will have 2 jobs which will be executed. How I can delete previous job so only updated one will be executed ?</p>
  
  <pre><code>Rails 3.0.7
  Delayed Job =&gt; 2.1.4 https://github.com/collectiveidea/delayed_job
  </code></pre>
  
  <p>ps: sorry for my english I try do my best </p>