active_job-performs 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 360213ab324cae80fefcf276ecb9803ed8e4ec62166dc9eded626b67f8329b97
4
- data.tar.gz: 92fa0c284711569f812da53e7acca9cbe15cea03aec0ccb9c2512465a7b93f39
3
+ metadata.gz: 673105da38e705ba9aa778566a9d711a631aea27467a354a4fc4413e16b31ac3
4
+ data.tar.gz: 632442f9d0c25be20d47ecc4038b8d36e20d2b4797b5a1b622d3b5dead074cc4
5
5
  SHA512:
6
- metadata.gz: 16fd7671e6eaeba29bac333597170661ca5333c3e14e3142ba910579316641dc2e2ba31f3fdd49508e5e0263a3fc67b34032e4ef61bb1b1a8dc3679a6a9ec26b
7
- data.tar.gz: 353e3cf1bc646e32883352a2f4ebb80121987e415872ce9d0e32256fcbed7f559e66576a1ee15b71e2fec3930d54f362a5b8905cd502cac7daf4df7b618191e3
6
+ metadata.gz: 7f1569149e481246401f737e48a032d6d579bdfcf39751daafc5b4991eecd7017a3e646ed573101d8c65ae6acf36b371c75bf2ed793fa22fef77fd5ca93fa25d
7
+ data.tar.gz: f1df1f52d96bc4fff67af97b1f675669da1eec01423b48ecc36451e2c290111d205ef839da6abe36929ba3edf685998a473f73ee55f3b01286a2df083ebfa988
data/Gemfile CHANGED
@@ -16,4 +16,4 @@ gem "debug"
16
16
  gem "activejob", ">= 7.1"
17
17
  gem "activerecord", ">= 7.1"
18
18
 
19
- gem "sqlite3", "~> 1.4"
19
+ gem "sqlite3"
data/Gemfile.lock CHANGED
@@ -7,59 +7,77 @@ PATH
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activejob (7.1.3.4)
11
- activesupport (= 7.1.3.4)
10
+ activejob (8.1.1)
11
+ activesupport (= 8.1.1)
12
12
  globalid (>= 0.3.6)
13
- activemodel (7.1.3.4)
14
- activesupport (= 7.1.3.4)
15
- activerecord (7.1.3.4)
16
- activemodel (= 7.1.3.4)
17
- activesupport (= 7.1.3.4)
13
+ activemodel (8.1.1)
14
+ activesupport (= 8.1.1)
15
+ activerecord (8.1.1)
16
+ activemodel (= 8.1.1)
17
+ activesupport (= 8.1.1)
18
18
  timeout (>= 0.4.0)
19
- activesupport (7.1.3.4)
19
+ activesupport (8.1.1)
20
20
  base64
21
21
  bigdecimal
22
- concurrent-ruby (~> 1.0, >= 1.0.2)
22
+ concurrent-ruby (~> 1.0, >= 1.3.1)
23
23
  connection_pool (>= 2.2.5)
24
24
  drb
25
25
  i18n (>= 1.6, < 2)
26
+ json
27
+ logger (>= 1.4.2)
26
28
  minitest (>= 5.1)
27
- mutex_m
28
- tzinfo (~> 2.0)
29
- base64 (0.2.0)
30
- bigdecimal (3.1.8)
31
- concurrent-ruby (1.3.3)
32
- connection_pool (2.4.1)
33
- debug (1.9.2)
29
+ securerandom (>= 0.3)
30
+ tzinfo (~> 2.0, >= 2.0.5)
31
+ uri (>= 0.13.1)
32
+ base64 (0.3.0)
33
+ bigdecimal (3.3.1)
34
+ concurrent-ruby (1.3.5)
35
+ connection_pool (2.5.5)
36
+ date (3.5.0)
37
+ debug (1.11.0)
34
38
  irb (~> 1.10)
35
39
  reline (>= 0.3.8)
36
- drb (2.2.1)
37
- globalid (1.2.1)
40
+ drb (2.2.3)
41
+ erb (6.0.0)
42
+ globalid (1.3.0)
38
43
  activesupport (>= 6.1)
39
- i18n (1.14.5)
44
+ i18n (1.14.7)
40
45
  concurrent-ruby (~> 1.0)
41
- io-console (0.7.2)
42
- irb (1.13.2)
46
+ io-console (0.8.1)
47
+ irb (1.15.3)
48
+ pp (>= 0.6.0)
43
49
  rdoc (>= 4.0.0)
44
50
  reline (>= 0.4.2)
45
- minitest (5.24.0)
46
- minitest-sprint (1.2.2)
51
+ json (2.16.0)
52
+ logger (1.7.0)
53
+ minitest (5.26.2)
54
+ minitest-sprint (1.4.1)
47
55
  path_expander (~> 1.1)
48
- mutex_m (0.2.0)
49
- path_expander (1.1.1)
50
- psych (5.1.2)
56
+ prism (~> 1.5)
57
+ path_expander (1.1.3)
58
+ pp (0.6.3)
59
+ prettyprint
60
+ prettyprint (0.2.0)
61
+ prism (1.6.0)
62
+ psych (5.2.6)
63
+ date
51
64
  stringio
52
- rake (13.2.1)
53
- rdoc (6.7.0)
65
+ rake (13.3.1)
66
+ rdoc (6.16.1)
67
+ erb
54
68
  psych (>= 4.0.0)
55
- reline (0.5.9)
69
+ tsort
70
+ reline (0.6.3)
56
71
  io-console (~> 0.5)
57
- sqlite3 (1.7.3-arm64-darwin)
58
- sqlite3 (1.7.3-x86_64-linux)
59
- stringio (3.1.1)
60
- timeout (0.4.1)
72
+ securerandom (0.4.1)
73
+ sqlite3 (2.8.0-arm64-darwin)
74
+ sqlite3 (2.8.0-x86_64-linux-gnu)
75
+ stringio (3.1.8)
76
+ timeout (0.4.4)
77
+ tsort (0.2.0)
61
78
  tzinfo (2.0.6)
62
79
  concurrent-ruby (~> 1.0)
80
+ uri (1.1.1)
63
81
 
64
82
  PLATFORMS
65
83
  arm64-darwin
@@ -73,7 +91,7 @@ DEPENDENCIES
73
91
  minitest (~> 5.0)
74
92
  minitest-sprint
75
93
  rake (~> 13.0)
76
- sqlite3 (~> 1.4)
94
+ sqlite3
77
95
 
78
96
  BUNDLED WITH
79
97
  2.5.14
data/README.md CHANGED
@@ -192,8 +192,7 @@ If there's an Active Record method that you'd like any model to be able to run f
192
192
  class ApplicationRecord < ActiveRecord::Base
193
193
  self.abstract_class = true
194
194
 
195
- # We're passing specific queues for monitoring, but you may not need or want them.
196
- performs :touch, queue_as: "active_record.touch"
195
+ # We're passing specific queues for monitoring, but they're optional.
197
196
  performs :update, queue_as: "active_record.update"
198
197
  performs :destroy, queue_as: "active_record.destroy"
199
198
  end
@@ -202,19 +201,21 @@ end
202
201
  Then a model could now run things like:
203
202
 
204
203
  ```ruby
205
- record.touch_later
206
- record.touch_later :reminded_at, time: 5.minutes.from_now # Pass supported arguments to `touch`
207
-
208
- record.update_later reminded_at: 1.year.ago
209
-
210
- # Particularly handy to use on a record with many `dependent: :destroy` associations.
211
- # Plus if anything fails, the transaction will rollback and the job fails, so you can retry it later!
204
+ record.update_later reminded_at: 1.year.ago # Forward along arguments to the eventual `update` call.
212
205
  record.destroy_later
213
206
  ```
214
207
 
215
- You may not want this for `touch` and `update`, and maybe you'd rather architect your system in such a way that they don't have so many side-effects, but having the option can be handy!
208
+ > [!TIP]
209
+ > `destroy_later` could be particularly useful on a record with many `dependent: :destroy` associations.
210
+ > If anything fails, the transaction will rollback and the job fails, so you can retry it later!
211
+
212
+ > [!NOTE]
213
+ > Maybe you'd rather architect your system such that these methods don't have so many side-effects, but having the option can be handy.
214
+
215
+ > [!WARNING]
216
+ > Don't use this pattern with `touch` because Rails has an internal [touch_later](https://github.com/rails/rails/blob/690ec8898318b8f50714e86676353ebe1551261e/activerecord/lib/active_record/touch_later.rb#L11) private API method used in `belongs_to <some_association>, touch: true` assocations. If your model is one day used in such an assocation and you were using this pattern your app would break.
216
217
 
217
- Also, I haven't tested all the Active Record methods, so please file an issue if you encounter any.
218
+ I haven't tested all the Active Record methods, so please file an issue if you encounter any.
218
219
 
219
220
  #### Method suffixes
220
221
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveJob
4
4
  module Performs
5
- VERSION = "0.3.3"
5
+ VERSION = "0.4.0"
6
6
  end
7
7
  end
@@ -55,8 +55,6 @@ module ActiveJob::Performs
55
55
  #{job}.scoped_by_wait(self).perform_later(self, *arguments, **options)
56
56
  end
57
57
  RUBY
58
-
59
- [method, :"#{method}_later#{suffix}"] # Ensure `private performs :some_method` privates both names.
60
58
  end
61
59
  end
62
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_job-performs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Timm Hansen
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  requirements: []
62
- rubygems_version: 3.6.9
62
+ rubygems_version: 3.7.2
63
63
  specification_version: 4
64
64
  summary: ActiveJob::Performs adds the `performs` macro to set up jobs by convention.
65
65
  test_files: []