activejob 6.0.0.beta1 → 6.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4efdf023b31288a45487abbafc8fc37207c470167a9f2d770a5d3364e4a7c399
4
- data.tar.gz: e2476b972bf30c7bfb9cdce2ee2fb5018e2253d6b1bb28142dcbb169bf834c2d
3
+ metadata.gz: 1629bb05f41e9fa8d313f89099f5d798eb2753303857597ebbd8dbefb6c2e0d7
4
+ data.tar.gz: 44a9a73bbdf05b621858b5a4cd2e4e1f59be579a984fe5f7dbb2517f140392dc
5
5
  SHA512:
6
- metadata.gz: 2f5b5589be292b9df0693b61a38f8a1b5d8a8b88ecd4ec2eb22556f18fd8795fa7be9f447057626ed9f852bb543807a96eefa28989a27f16ee946a5e91550614
7
- data.tar.gz: 694d741cfd413f0bae6165706b5924a6cb5ae7a6240d5fc6d09c3cc1b4020d1fc3006ae154b932a3734126530b3ff112c29f56839ca9b630ab7ed467dda3f38a
6
+ metadata.gz: c6ff844405408632c22be01751e99824849752bc6188712d96ffe43e5c61818f1425a9cd3ecce08b31d8dfec8aa6f657c6c11237058fe74485786029504d1091
7
+ data.tar.gz: c993fbbb37c36a67690927c1ae387bd5e6ff8de9b43ca8757c1c5167834424dfd3c7f801f70594e194949d74f66028be0e5846e28e959279e250c668c549351f
@@ -1,3 +1,8 @@
1
+ ## Rails 6.0.0.beta2 (February 25, 2019) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 6.0.0.beta1 (January 18, 2019) ##
2
7
 
3
8
  * Return false instead of the job instance when `enqueue` is aborted.
@@ -40,6 +40,9 @@ module ActiveJob
40
40
  # Timezone to be used during the job.
41
41
  attr_accessor :timezone
42
42
 
43
+ # Track when a job was enqueued
44
+ attr_accessor :enqueued_at
45
+
43
46
  # These methods will be included into any Active Job object, adding
44
47
  # helpers for de/serialization and creation of job instances.
45
48
  module ClassMethods
@@ -97,7 +100,8 @@ module ActiveJob
97
100
  "executions" => executions,
98
101
  "exception_executions" => exception_executions,
99
102
  "locale" => I18n.locale.to_s,
100
- "timezone" => Time.zone.try(:name)
103
+ "timezone" => Time.zone.try(:name),
104
+ "enqueued_at" => Time.now.utc.iso8601
101
105
  }
102
106
  end
103
107
 
@@ -137,6 +141,7 @@ module ActiveJob
137
141
  self.exception_executions = job_data["exception_executions"]
138
142
  self.locale = job_data["locale"] || I18n.locale.to_s
139
143
  self.timezone = job_data["timezone"] || Time.zone.try(:name)
144
+ self.enqueued_at = job_data["enqueued_at"]
140
145
  end
141
146
 
142
147
  private
@@ -67,7 +67,7 @@ module ActiveJob
67
67
  false
68
68
  else
69
69
  ActiveSupport::Deprecation.warn(
70
- "Rails 6.0 will return false when the enqueing is aborted. Make sure your code doesn't depend on it" \
70
+ "Rails 6.0 will return false when the enqueuing is aborted. Make sure your code doesn't depend on it" \
71
71
  " returning the instance of the job and set `config.active_job.return_false_on_aborted_enqueue = true`" \
72
72
  " to remove the deprecations."
73
73
  )
@@ -10,7 +10,7 @@ module ActiveJob
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
12
  TINY = 0
13
- PRE = "beta1"
13
+ PRE = "beta2"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -70,7 +70,7 @@ module ActiveJob
70
70
  def perform_start(event)
71
71
  info do
72
72
  job = event.payload[:job]
73
- "Performing #{job.class.name} (Job ID: #{job.job_id}) from #{queue_name(event)}" + args_info(job)
73
+ "Performing #{job.class.name} (Job ID: #{job.job_id}) from #{queue_name(event)} enqueued at #{job.enqueued_at}" + args_info(job)
74
74
  end
75
75
  end
76
76
 
@@ -18,6 +18,26 @@ module ActiveJob
18
18
  # post.to_feed!
19
19
  # end
20
20
  # end
21
+ #
22
+ # Can be given a block that will evaluate in the context of the job
23
+ # allowing +self.arguments+ to be accessed so that a dynamic queue name
24
+ # can be applied:
25
+ #
26
+ # class PublishToFeedJob < ApplicationJob
27
+ # queue_as do
28
+ # post = self.arguments.first
29
+ #
30
+ # if post.paid?
31
+ # :paid_feeds
32
+ # else
33
+ # :feeds
34
+ # end
35
+ # end
36
+ #
37
+ # def perform(post)
38
+ # post.to_feed!
39
+ # end
40
+ # end
21
41
  def queue_as(part_name = nil, &block)
22
42
  if block_given?
23
43
  self.queue_name = block
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.beta1
4
+ version: 6.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-18 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.0.beta1
19
+ version: 6.0.0.beta2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 6.0.0.beta1
26
+ version: 6.0.0.beta2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: globalid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -94,8 +94,8 @@ homepage: http://rubyonrails.org
94
94
  licenses:
95
95
  - MIT
96
96
  metadata:
97
- source_code_uri: https://github.com/rails/rails/tree/v6.0.0.beta1/activejob
98
- changelog_uri: https://github.com/rails/rails/blob/v6.0.0.beta1/activejob/CHANGELOG.md
97
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.0.beta2/activejob
98
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.0.beta2/activejob/CHANGELOG.md
99
99
  post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths: