From 15ddf60e05f5995b1aaf8d8cecfa2354005cc035 Mon Sep 17 00:00:00 2001 From: Cristian Bica Date: Thu, 4 Sep 2014 08:08:06 +0300 Subject: Rename remaining :in / :at to :wait / :wait_until --- activejob/lib/active_job/configured_job.rb | 2 -- activejob/lib/active_job/enqueuing.rb | 16 ++++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'activejob') diff --git a/activejob/lib/active_job/configured_job.rb b/activejob/lib/active_job/configured_job.rb index 61efc9b09e..979280b910 100644 --- a/activejob/lib/active_job/configured_job.rb +++ b/activejob/lib/active_job/configured_job.rb @@ -2,8 +2,6 @@ module ActiveJob class ConfiguredJob #:nodoc: def initialize(job_class, options={}) @options = options - @options[:in] = @options.delete(:wait) if @options[:wait] - @options[:at] = @options.delete(:wait_until) if @options[:wait_until] @job_class = job_class end diff --git a/activejob/lib/active_job/enqueuing.rb b/activejob/lib/active_job/enqueuing.rb index 32453930cc..e8bc44cbc4 100644 --- a/activejob/lib/active_job/enqueuing.rb +++ b/activejob/lib/active_job/enqueuing.rb @@ -27,8 +27,8 @@ module ActiveJob # you can ask Active Job to retry performing your job. # # ==== Options - # * :in - Enqueues the job with the specified delay - # * :at - Enqueues the job at the time specified + # * :wait - Enqueues the job with the specified delay + # * :wait_until - Enqueues the job at the time specified # * :queue - Enqueues the job on the specified queue # # ==== Examples @@ -48,19 +48,19 @@ module ActiveJob # Equeue the job to be performed by the queue adapter. # # ==== Options - # * :in - Enqueues the job with the specified delay - # * :at - Enqueues the job at the time specified + # * :wait - Enqueues the job with the specified delay + # * :wait_until - Enqueues the job at the time specified # * :queue - Enqueues the job on the specified queue # # ==== Examples # # my_job_instance.enqueue - # my_job_instance.enqueue in: 5.minutes + # my_job_instance.enqueue wait: 5.minutes # my_job_instance.enqueue queue: :important - # my_job_instance.enqueue at: Date.tomorrow.midnight + # my_job_instance.enqueue wait_until: Date.tomorrow.midnight def enqueue(options={}) - self.scheduled_at = options[:in].seconds.from_now.to_f if options[:in] - self.scheduled_at = options[:at].to_f if options[:at] + self.scheduled_at = options[:wait].seconds.from_now.to_f if options[:wait] + self.scheduled_at = options[:wait_until].to_f if options[:wait_until] self.queue_name = self.class.queue_name_from_part(options[:queue]) if options[:queue] run_callbacks :enqueue do if self.scheduled_at -- cgit v1.2.3