active_job_log 2.0.0 → 3.0.0

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: dba3c2ac8737c2eb3ca017c3076303b46007ce3b1d410377437f613d8840edbb
4
- data.tar.gz: d1cb759e84634d425728e83d859e29ea9796386d1303340e9fc29060ec1fd81e
3
+ metadata.gz: d995c15d7ce558b13df9aa8a93dc16803aa293c71115cde705346525fd18e978
4
+ data.tar.gz: '039703a5a0698f5615efd2a1b811f1797d2c5d5116ec5b6c408d66841dae7cc1'
5
5
  SHA512:
6
- metadata.gz: 32a50d61161aead9971cd4e688260f57491955c83cf0076d59990b5df98396b4a3ad4632a9894f3044bc4386ddd3dbae7f50c1a6c5222b4b902a2bbc1e9c1d48
7
- data.tar.gz: 7d32934735dd7218ea77237473e0e91872a6e129e32701b779089340cd5f019ffdec1864c9b7f7d590a52e89d0863401ebfd9e1fc7c059efac5fbf1ac1222c59
6
+ metadata.gz: c7440e25d80a54090b6fbe25ed1e21e8d23a7289c10db25245cf9563bbad453ee494b8b1672cb43691d61efeb4e62eda001129da800fbc1d2602d69d06722aa9
7
+ data.tar.gz: 45e191cb100b18e33f0ba12c0c0f2ab3490fd1163fb0eb7bb61099565fbea5df0fe9773b76af983819fc6ce2fe0cfbe0a0c4836943d3e5caa1a653e1f1f03b56
data/.circleci/config.yml CHANGED
@@ -14,10 +14,10 @@ executors:
14
14
  parameters:
15
15
  ruby-version:
16
16
  description: "Ruby version"
17
- default: "2.7"
17
+ default: "3.2"
18
18
  type: string
19
19
  docker:
20
- - image: circleci/ruby:<<parameters.ruby-version>>-node
20
+ - image: cimg/ruby:<<parameters.ruby-version>>-node
21
21
  environment: *env-vars
22
22
 
23
23
  commands:
@@ -94,7 +94,7 @@ workflows:
94
94
  - test:
95
95
  matrix:
96
96
  parameters:
97
- ruby-version: ["2.5", "2.6", "2.7"]
97
+ ruby-version: [ "2.7", "3.1", "3.2"]
98
98
  - deploy:
99
99
  context: org-global
100
100
  filters:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7
1
+ 3.2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ### v3.0.0
6
+
7
+ #### Changed
8
+
9
+ * Add Ruby 3.2 support
10
+ * Remove Ruby 2.5 and 2.6 support
11
+
12
+ ### v2.1.0
13
+
14
+ #### Added
15
+
16
+ * Avoid logging using `disable_job_logs` class method.
17
+
5
18
  ### v2.0.0
6
19
 
7
20
  #### Changed
data/Gemfile.lock CHANGED
@@ -1,76 +1,82 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_job_log (2.0.0)
4
+ active_job_log (3.0.0)
5
5
  enumerize (>= 1.0)
6
6
  rails (>= 6.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (6.1.3.2)
12
- actionpack (= 6.1.3.2)
13
- activesupport (= 6.1.3.2)
11
+ actioncable (7.0.6)
12
+ actionpack (= 7.0.6)
13
+ activesupport (= 7.0.6)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (>= 0.6.1)
16
- actionmailbox (6.1.3.2)
17
- actionpack (= 6.1.3.2)
18
- activejob (= 6.1.3.2)
19
- activerecord (= 6.1.3.2)
20
- activestorage (= 6.1.3.2)
21
- activesupport (= 6.1.3.2)
16
+ actionmailbox (7.0.6)
17
+ actionpack (= 7.0.6)
18
+ activejob (= 7.0.6)
19
+ activerecord (= 7.0.6)
20
+ activestorage (= 7.0.6)
21
+ activesupport (= 7.0.6)
22
22
  mail (>= 2.7.1)
23
- actionmailer (6.1.3.2)
24
- actionpack (= 6.1.3.2)
25
- actionview (= 6.1.3.2)
26
- activejob (= 6.1.3.2)
27
- activesupport (= 6.1.3.2)
23
+ net-imap
24
+ net-pop
25
+ net-smtp
26
+ actionmailer (7.0.6)
27
+ actionpack (= 7.0.6)
28
+ actionview (= 7.0.6)
29
+ activejob (= 7.0.6)
30
+ activesupport (= 7.0.6)
28
31
  mail (~> 2.5, >= 2.5.4)
32
+ net-imap
33
+ net-pop
34
+ net-smtp
29
35
  rails-dom-testing (~> 2.0)
30
- actionpack (6.1.3.2)
31
- actionview (= 6.1.3.2)
32
- activesupport (= 6.1.3.2)
33
- rack (~> 2.0, >= 2.0.9)
36
+ actionpack (7.0.6)
37
+ actionview (= 7.0.6)
38
+ activesupport (= 7.0.6)
39
+ rack (~> 2.0, >= 2.2.4)
34
40
  rack-test (>= 0.6.3)
35
41
  rails-dom-testing (~> 2.0)
36
42
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.1.3.2)
38
- actionpack (= 6.1.3.2)
39
- activerecord (= 6.1.3.2)
40
- activestorage (= 6.1.3.2)
41
- activesupport (= 6.1.3.2)
43
+ actiontext (7.0.6)
44
+ actionpack (= 7.0.6)
45
+ activerecord (= 7.0.6)
46
+ activestorage (= 7.0.6)
47
+ activesupport (= 7.0.6)
48
+ globalid (>= 0.6.0)
42
49
  nokogiri (>= 1.8.5)
43
- actionview (6.1.3.2)
44
- activesupport (= 6.1.3.2)
50
+ actionview (7.0.6)
51
+ activesupport (= 7.0.6)
45
52
  builder (~> 3.1)
46
53
  erubi (~> 1.4)
47
54
  rails-dom-testing (~> 2.0)
48
55
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.1.3.2)
50
- activesupport (= 6.1.3.2)
56
+ activejob (7.0.6)
57
+ activesupport (= 7.0.6)
51
58
  globalid (>= 0.3.6)
52
- activemodel (6.1.3.2)
53
- activesupport (= 6.1.3.2)
54
- activerecord (6.1.3.2)
55
- activemodel (= 6.1.3.2)
56
- activesupport (= 6.1.3.2)
57
- activestorage (6.1.3.2)
58
- actionpack (= 6.1.3.2)
59
- activejob (= 6.1.3.2)
60
- activerecord (= 6.1.3.2)
61
- activesupport (= 6.1.3.2)
62
- marcel (~> 1.0.0)
63
- mini_mime (~> 1.0.2)
64
- activesupport (6.1.3.2)
59
+ activemodel (7.0.6)
60
+ activesupport (= 7.0.6)
61
+ activerecord (7.0.6)
62
+ activemodel (= 7.0.6)
63
+ activesupport (= 7.0.6)
64
+ activestorage (7.0.6)
65
+ actionpack (= 7.0.6)
66
+ activejob (= 7.0.6)
67
+ activerecord (= 7.0.6)
68
+ activesupport (= 7.0.6)
69
+ marcel (~> 1.0)
70
+ mini_mime (>= 1.1.0)
71
+ activesupport (7.0.6)
65
72
  concurrent-ruby (~> 1.0, >= 1.0.2)
66
73
  i18n (>= 1.6, < 2)
67
74
  minitest (>= 5.1)
68
75
  tzinfo (~> 2.0)
69
- zeitwerk (~> 2.3)
70
76
  ast (2.4.2)
71
77
  builder (3.2.4)
72
78
  coderay (1.1.3)
73
- concurrent-ruby (1.1.9)
79
+ concurrent-ruby (1.2.2)
74
80
  coveralls (0.8.23)
75
81
  json (>= 1.8, < 3)
76
82
  simplecov (~> 0.16.1)
@@ -78,141 +84,155 @@ GEM
78
84
  thor (>= 0.19.4, < 2.0)
79
85
  tins (~> 1.6)
80
86
  crass (1.0.6)
81
- diff-lcs (1.4.4)
87
+ date (3.3.3)
88
+ diff-lcs (1.5.0)
82
89
  docile (1.4.0)
83
- enumerize (2.4.0)
90
+ enumerize (2.6.1)
84
91
  activesupport (>= 3.2)
85
- erubi (1.10.0)
86
- factory_bot (6.2.0)
92
+ erubi (1.12.0)
93
+ factory_bot (6.2.1)
87
94
  activesupport (>= 5.0.0)
88
95
  factory_bot_rails (6.2.0)
89
96
  factory_bot (~> 6.2.0)
90
97
  railties (>= 5.0.0)
91
- globalid (0.4.2)
92
- activesupport (>= 4.2.0)
93
- i18n (1.8.10)
98
+ globalid (1.1.0)
99
+ activesupport (>= 5.0)
100
+ i18n (1.14.1)
94
101
  concurrent-ruby (~> 1.0)
95
- json (2.5.1)
96
- loofah (2.10.0)
102
+ json (2.6.3)
103
+ language_server-protocol (3.17.0.3)
104
+ loofah (2.21.3)
97
105
  crass (~> 1.0.2)
98
- nokogiri (>= 1.5.9)
99
- mail (2.7.1)
106
+ nokogiri (>= 1.12.0)
107
+ mail (2.8.1)
100
108
  mini_mime (>= 0.1.1)
101
- marcel (1.0.1)
109
+ net-imap
110
+ net-pop
111
+ net-smtp
112
+ marcel (1.0.2)
102
113
  method_source (1.0.0)
103
- mini_mime (1.0.3)
104
- minitest (5.14.4)
105
- nio4r (2.5.7)
106
- nokogiri (1.11.7-x86_64-darwin)
114
+ mini_mime (1.1.2)
115
+ minitest (5.18.1)
116
+ net-imap (0.3.6)
117
+ date
118
+ net-protocol
119
+ net-pop (0.1.2)
120
+ net-protocol
121
+ net-protocol (0.2.1)
122
+ timeout
123
+ net-smtp (0.3.3)
124
+ net-protocol
125
+ nio4r (2.5.9)
126
+ nokogiri (1.15.2-arm64-darwin)
107
127
  racc (~> 1.4)
108
- nokogiri (1.11.7-x86_64-linux)
128
+ nokogiri (1.15.2-x86_64-linux)
109
129
  racc (~> 1.4)
110
- parallel (1.20.1)
111
- parser (3.0.1.1)
130
+ parallel (1.23.0)
131
+ parser (3.2.2.3)
112
132
  ast (~> 2.4.1)
113
- pry (0.14.1)
133
+ racc
134
+ pry (0.14.2)
114
135
  coderay (~> 1.1)
115
136
  method_source (~> 1.0)
116
137
  pry-rails (0.3.9)
117
138
  pry (>= 0.10.4)
118
- racc (1.5.2)
119
- rack (2.2.3)
120
- rack-test (1.1.0)
121
- rack (>= 1.0, < 3)
122
- rails (6.1.3.2)
123
- actioncable (= 6.1.3.2)
124
- actionmailbox (= 6.1.3.2)
125
- actionmailer (= 6.1.3.2)
126
- actionpack (= 6.1.3.2)
127
- actiontext (= 6.1.3.2)
128
- actionview (= 6.1.3.2)
129
- activejob (= 6.1.3.2)
130
- activemodel (= 6.1.3.2)
131
- activerecord (= 6.1.3.2)
132
- activestorage (= 6.1.3.2)
133
- activesupport (= 6.1.3.2)
139
+ racc (1.7.1)
140
+ rack (2.2.7)
141
+ rack-test (2.1.0)
142
+ rack (>= 1.3)
143
+ rails (7.0.6)
144
+ actioncable (= 7.0.6)
145
+ actionmailbox (= 7.0.6)
146
+ actionmailer (= 7.0.6)
147
+ actionpack (= 7.0.6)
148
+ actiontext (= 7.0.6)
149
+ actionview (= 7.0.6)
150
+ activejob (= 7.0.6)
151
+ activemodel (= 7.0.6)
152
+ activerecord (= 7.0.6)
153
+ activestorage (= 7.0.6)
154
+ activesupport (= 7.0.6)
134
155
  bundler (>= 1.15.0)
135
- railties (= 6.1.3.2)
136
- sprockets-rails (>= 2.0.0)
137
- rails-dom-testing (2.0.3)
138
- activesupport (>= 4.2.0)
156
+ railties (= 7.0.6)
157
+ rails-dom-testing (2.1.1)
158
+ activesupport (>= 5.0.0)
159
+ minitest
139
160
  nokogiri (>= 1.6)
140
- rails-html-sanitizer (1.3.0)
141
- loofah (~> 2.3)
142
- railties (6.1.3.2)
143
- actionpack (= 6.1.3.2)
144
- activesupport (= 6.1.3.2)
161
+ rails-html-sanitizer (1.6.0)
162
+ loofah (~> 2.21)
163
+ nokogiri (~> 1.14)
164
+ railties (7.0.6)
165
+ actionpack (= 7.0.6)
166
+ activesupport (= 7.0.6)
145
167
  method_source
146
- rake (>= 0.8.7)
168
+ rake (>= 12.2)
147
169
  thor (~> 1.0)
148
- rainbow (3.0.0)
149
- rake (13.0.3)
150
- regexp_parser (2.1.1)
170
+ zeitwerk (~> 2.5)
171
+ rainbow (3.1.1)
172
+ rake (13.0.6)
173
+ regexp_parser (2.8.1)
151
174
  rexml (3.2.5)
152
- rspec-core (3.10.1)
153
- rspec-support (~> 3.10.0)
154
- rspec-expectations (3.10.1)
175
+ rspec-core (3.12.2)
176
+ rspec-support (~> 3.12.0)
177
+ rspec-expectations (3.12.3)
155
178
  diff-lcs (>= 1.2.0, < 2.0)
156
- rspec-support (~> 3.10.0)
157
- rspec-mocks (3.10.2)
179
+ rspec-support (~> 3.12.0)
180
+ rspec-mocks (3.12.5)
158
181
  diff-lcs (>= 1.2.0, < 2.0)
159
- rspec-support (~> 3.10.0)
160
- rspec-rails (5.0.1)
161
- actionpack (>= 5.2)
162
- activesupport (>= 5.2)
163
- railties (>= 5.2)
164
- rspec-core (~> 3.10)
165
- rspec-expectations (~> 3.10)
166
- rspec-mocks (~> 3.10)
167
- rspec-support (~> 3.10)
168
- rspec-support (3.10.2)
169
- rspec_junit_formatter (0.4.1)
182
+ rspec-support (~> 3.12.0)
183
+ rspec-rails (6.0.3)
184
+ actionpack (>= 6.1)
185
+ activesupport (>= 6.1)
186
+ railties (>= 6.1)
187
+ rspec-core (~> 3.12)
188
+ rspec-expectations (~> 3.12)
189
+ rspec-mocks (~> 3.12)
190
+ rspec-support (~> 3.12)
191
+ rspec-support (3.12.1)
192
+ rspec_junit_formatter (0.6.0)
170
193
  rspec-core (>= 2, < 4, != 2.12.0)
171
- rubocop (1.17.0)
194
+ rubocop (1.54.0)
195
+ json (~> 2.3)
196
+ language_server-protocol (>= 3.17.0)
172
197
  parallel (~> 1.10)
173
- parser (>= 3.0.0.0)
198
+ parser (>= 3.2.2.3)
174
199
  rainbow (>= 2.2.2, < 4.0)
175
200
  regexp_parser (>= 1.8, < 3.0)
176
- rexml
177
- rubocop-ast (>= 1.7.0, < 2.0)
201
+ rexml (>= 3.2.5, < 4.0)
202
+ rubocop-ast (>= 1.28.0, < 2.0)
178
203
  ruby-progressbar (~> 1.7)
179
- unicode-display_width (>= 1.4.0, < 3.0)
180
- rubocop-ast (1.7.0)
181
- parser (>= 3.0.1.1)
182
- rubocop-rails (2.10.1)
204
+ unicode-display_width (>= 2.4.0, < 3.0)
205
+ rubocop-ast (1.29.0)
206
+ parser (>= 3.2.1.0)
207
+ rubocop-rails (2.20.2)
183
208
  activesupport (>= 4.2.0)
184
209
  rack (>= 1.1)
185
- rubocop (>= 1.7.0, < 2.0)
186
- ruby-progressbar (1.11.0)
210
+ rubocop (>= 1.33.0, < 2.0)
211
+ ruby-progressbar (1.13.0)
187
212
  simplecov (0.16.1)
188
213
  docile (~> 1.1)
189
214
  json (>= 1.8, < 3)
190
215
  simplecov-html (~> 0.10.0)
191
216
  simplecov-html (0.10.2)
192
- sprockets (4.0.2)
193
- concurrent-ruby (~> 1.0)
194
- rack (> 1, < 3)
195
- sprockets-rails (3.2.2)
196
- actionpack (>= 4.0)
197
- activesupport (>= 4.0)
198
- sprockets (>= 3.0.0)
199
- sqlite3 (1.4.2)
217
+ sqlite3 (1.6.3-arm64-darwin)
218
+ sqlite3 (1.6.3-x86_64-linux)
200
219
  sync (0.5.0)
201
220
  term-ansicolor (1.7.1)
202
221
  tins (~> 1.0)
203
- thor (1.1.0)
204
- tins (1.29.1)
222
+ thor (1.2.2)
223
+ timeout (0.4.0)
224
+ tins (1.32.1)
205
225
  sync
206
- tzinfo (2.0.4)
226
+ tzinfo (2.0.6)
207
227
  concurrent-ruby (~> 1.0)
208
- unicode-display_width (2.0.0)
228
+ unicode-display_width (2.4.2)
209
229
  websocket-driver (0.7.5)
210
230
  websocket-extensions (>= 0.1.0)
211
231
  websocket-extensions (0.1.5)
212
- zeitwerk (2.4.2)
232
+ zeitwerk (2.6.8)
213
233
 
214
234
  PLATFORMS
215
- x86_64-darwin-20
235
+ arm64-darwin-22
216
236
  x86_64-linux
217
237
 
218
238
  DEPENDENCIES
@@ -228,4 +248,4 @@ DEPENDENCIES
228
248
  sqlite3
229
249
 
230
250
  BUNDLED WITH
231
- 2.2.15
251
+ 2.4.15
data/README.md CHANGED
@@ -99,6 +99,20 @@ queued pending finished failed
99
99
 
100
100
  - `executions`: number of times this job has been executed (which increments on every retry, like after an exception.
101
101
 
102
+ ### Disable logging
103
+
104
+ If you want to avoid logging a specific job you have to add `disable_job_logs` config option on that job. For example:
105
+
106
+ ```ruby
107
+ class MyJob < ActiveJob::Base
108
+ disable_job_logs
109
+
110
+ def perform(param1, param2)
111
+ # ...
112
+ end
113
+ end
114
+ ```
115
+
102
116
  ### Important
103
117
 
104
118
  If your job calls the `rescue_from` method, you will need to call the `fail_job` method explicitly to log the job completion. For example:
@@ -3,6 +3,8 @@ module ActiveJobLog
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
+ class_attribute :disabled_log
7
+
6
8
  before_enqueue { |job| enqueue_job(job) }
7
9
  before_perform { |job| execute_job(job) }
8
10
  after_perform { |job| finish_job(job) }
@@ -11,31 +13,48 @@ module ActiveJobLog
11
13
  fail_job(exception)
12
14
  raise exception
13
15
  end
16
+ end
14
17
 
15
- def enqueue_job(job)
16
- Job.update_job!(job.job_id, :queued, init_params(job))
18
+ class_methods do
19
+ def disable_job_logs
20
+ self.disabled_log = true
17
21
  end
22
+ end
18
23
 
19
- def execute_job(job)
20
- Job.update_job!(job.job_id, :pending, init_params(job))
21
- end
24
+ def enqueue_job(job)
25
+ update_job!(job.job_id, :queued, init_params(job))
26
+ end
22
27
 
23
- def finish_job(job)
24
- Job.update_job!(job.job_id, :finished)
25
- end
28
+ def execute_job(job)
29
+ update_job!(job.job_id, :pending, init_params(job))
30
+ end
26
31
 
27
- def fail_job(exception)
28
- Job.update_job!(job_id, :failed, error: exception.message, stack_trace: exception.backtrace)
29
- end
32
+ def finish_job(job)
33
+ update_job!(job.job_id, :finished)
34
+ end
30
35
 
31
- def init_params(job)
32
- {
33
- job_class: self.class.name,
34
- params: job.arguments,
35
- executions: job.try(:executions),
36
- queue_name: job.queue_name
37
- }
38
- end
36
+ def fail_job(exception)
37
+ update_job!(
38
+ job_id,
39
+ :failed,
40
+ error: exception.message,
41
+ stack_trace: exception.backtrace
42
+ )
43
+ end
44
+
45
+ def update_job!(job_id, status, params = {})
46
+ return if self.class.disabled_log
47
+
48
+ Job.update_job!(job_id, status, params)
49
+ end
50
+
51
+ def init_params(job)
52
+ {
53
+ job_class: self.class.name,
54
+ params: job.arguments,
55
+ executions: job.try(:executions),
56
+ queue_name: job.queue_name
57
+ }
39
58
  end
40
59
  end
41
60
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveJobLog
2
- VERSION = '2.0.0'
2
+ VERSION = '3.0.0'
3
3
  end
@@ -1,15 +1,9 @@
1
1
  require 'rails_helper'
2
2
 
3
3
  RSpec.describe ActiveJobLog::LogExt do
4
- def remove_job_class
5
- Object.send(:remove_const, :TestJob)
6
- rescue
7
- nil
8
- end
9
-
10
- def perform_now
11
- TestJob.perform_now(*job_params)
12
- rescue
4
+ def perform_now(job_class)
5
+ job_class.perform_now(*job_params)
6
+ rescue StandardError
13
7
  nil
14
8
  end
15
9
 
@@ -17,19 +11,21 @@ RSpec.describe ActiveJobLog::LogExt do
17
11
  %w{p1 p2}
18
12
  end
19
13
 
20
- before { remove_job_class }
21
-
22
14
  it { expect(ActiveJobLog::Job.count).to eq(0) }
23
15
 
24
16
  context "with successful job" do
25
- before do
26
- class TestJob < ActiveJob::Base
17
+ let(:job_class) do
18
+ klass = Class.new(ApplicationJob) do
27
19
  def perform(param1, param2)
28
20
  "success with #{param1} and #{param2}"
29
21
  end
30
22
  end
31
23
 
32
- perform_now
24
+ stub_const('TestJob', klass)
25
+ end
26
+
27
+ before do
28
+ perform_now(job_class)
33
29
  @job = ActiveJobLog::Job.last
34
30
  end
35
31
 
@@ -51,14 +47,18 @@ RSpec.describe ActiveJobLog::LogExt do
51
47
  end
52
48
 
53
49
  context "with failed job" do
54
- before do
55
- class TestJob < ActiveJob::Base
50
+ let(:job_class) do
51
+ klass = Class.new(ApplicationJob) do
56
52
  def perform(_param1, _param2)
57
53
  raise "error"
58
54
  end
59
55
  end
60
56
 
61
- perform_now
57
+ stub_const('TestJob', klass)
58
+ end
59
+
60
+ before do
61
+ perform_now(job_class)
62
62
  @job = ActiveJobLog::Job.last
63
63
  end
64
64
 
@@ -78,4 +78,37 @@ RSpec.describe ActiveJobLog::LogExt do
78
78
  it { expect(@job.total_duration).not_to be_nil }
79
79
  it { expect(@job.executions).to eq(1) }
80
80
  end
81
+
82
+ context "with disabled jobs" do
83
+ let(:disabled_job_class) do
84
+ klass = Class.new(ApplicationJob) do
85
+ disable_job_logs
86
+
87
+ def perform(_param1, _param2)
88
+ # ...
89
+ end
90
+ end
91
+
92
+ stub_const('DisabledTestJob', klass)
93
+ end
94
+
95
+ let(:enabled_job_class) do
96
+ klass = Class.new(ApplicationJob) do
97
+ def perform(_param1, _param2)
98
+ # ...
99
+ end
100
+ end
101
+
102
+ stub_const('EnabledTestJob', klass)
103
+ end
104
+
105
+ before do
106
+ perform_now(disabled_job_class)
107
+ perform_now(enabled_job_class)
108
+ @job = ActiveJobLog::Job.last
109
+ end
110
+
111
+ it { expect(ActiveJobLog::Job.count).to eq(1) }
112
+ it { expect(@job.job_class).to eq('EnabledTestJob') }
113
+ end
81
114
  end
data/spec/rails_helper.rb CHANGED
@@ -25,6 +25,7 @@ require "pry"
25
25
  require "spec_helper"
26
26
  require "rspec/rails"
27
27
  require "factory_bot_rails"
28
+ require "enumerize/integrations/rspec"
28
29
 
29
30
  ActiveRecord::Migration.maintain_test_schema!
30
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_job_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-06-22 00:00:00.000000000 Z
12
+ date: 2023-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -239,7 +239,6 @@ files:
239
239
  - spec/dummy/config/environments/production.rb
240
240
  - spec/dummy/config/environments/test.rb
241
241
  - spec/dummy/config/initializers/application_controller_renderer.rb
242
- - spec/dummy/config/initializers/assets.rb
243
242
  - spec/dummy/config/initializers/backtrace_silencers.rb
244
243
  - spec/dummy/config/initializers/content_security_policy.rb
245
244
  - spec/dummy/config/initializers/cookies_serializer.rb
@@ -287,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
286
  - !ruby/object:Gem::Version
288
287
  version: '0'
289
288
  requirements: []
290
- rubygems_version: 3.1.6
289
+ rubygems_version: 3.4.10
291
290
  signing_key:
292
291
  specification_version: 4
293
292
  summary: Rails engine to keep jobs history
@@ -310,7 +309,6 @@ test_files:
310
309
  - spec/dummy/bin/rails
311
310
  - spec/dummy/bin/rake
312
311
  - spec/dummy/bin/setup
313
- - spec/dummy/config.ru
314
312
  - spec/dummy/config/application.rb
315
313
  - spec/dummy/config/boot.rb
316
314
  - spec/dummy/config/cable.yml
@@ -320,7 +318,6 @@ test_files:
320
318
  - spec/dummy/config/environments/production.rb
321
319
  - spec/dummy/config/environments/test.rb
322
320
  - spec/dummy/config/initializers/application_controller_renderer.rb
323
- - spec/dummy/config/initializers/assets.rb
324
321
  - spec/dummy/config/initializers/backtrace_silencers.rb
325
322
  - spec/dummy/config/initializers/content_security_policy.rb
326
323
  - spec/dummy/config/initializers/cookies_serializer.rb
@@ -333,6 +330,7 @@ test_files:
333
330
  - spec/dummy/config/puma.rb
334
331
  - spec/dummy/config/routes.rb
335
332
  - spec/dummy/config/storage.yml
333
+ - spec/dummy/config.ru
336
334
  - spec/dummy/db/schema.rb
337
335
  - spec/dummy/package.json
338
336
  - spec/dummy/public/404.html
@@ -1,12 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Add additional assets to the asset load path.
7
- # Rails.application.config.assets.paths << Emoji.images_path
8
-
9
- # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in the app/assets
11
- # folder are already added.
12
- # Rails.application.config.assets.precompile += %w( admin.js admin.css )