paper_trail-background 1.0.0 → 1.0.1
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 +4 -4
- data/README.md +25 -2
- data/lib/paper_trail/background/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801abe0ea0d7e83c628f71db2a9983b00af26f9b68a66a2e5cc79fce306abb2c
|
4
|
+
data.tar.gz: 68e276d1635253b002c84eb45b644cc85d9e4b35f1595da87de4552a6755b31d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f4ddea7993170dad7a1c611bf21b3097a090764a0c19f962f07431047d2e05726645e29afd7d12e90796dc151f032329b556e27369f9eb19ec864b7022de4e
|
7
|
+
data.tar.gz: 26b673571563ed840b85dc63faa4da4144bd017948f0c33b7b8001cf20cb249e8e4c6a8fe409884767bf6bfeb4858041e01d97e7f846a4f064cf427ed84645b2
|
data/README.md
CHANGED
@@ -5,12 +5,29 @@
|
|
5
5
|
- [](https://rubygems.org/gems/paper_trail-background)
|
6
6
|
|
7
7
|
|
8
|
-
|
8
|
+
Allows you to enqueue version creation/deletion as a background job to avoid having business logic blocked by changelog writing.
|
9
9
|
|
10
10
|
|
11
11
|
## Using
|
12
12
|
|
13
|
-
|
13
|
+
First you'll need to setup a job for processing versions:
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
# The class MUST be named this
|
17
|
+
class VersionJob < ApplicationJob
|
18
|
+
|
19
|
+
# These are settings you'll probably want, I suggest sidekiq-unique-jobs
|
20
|
+
sidekiq_options(
|
21
|
+
:queue => "versions",
|
22
|
+
:unique_across_queues => true,
|
23
|
+
:lock => :until_executed,
|
24
|
+
:log_duplicate_payload => true
|
25
|
+
)
|
26
|
+
|
27
|
+
# This wires up the background job
|
28
|
+
include PaperTrail::Background::Sidekiq
|
29
|
+
end
|
30
|
+
```
|
14
31
|
|
15
32
|
|
16
33
|
## Installing
|
@@ -32,3 +49,9 @@ Or install it yourself with:
|
|
32
49
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
33
50
|
5. Push to the branch (`git push origin my-new-feature`)
|
34
51
|
6. Create new Pull Request
|
52
|
+
|
53
|
+
|
54
|
+
## Todo
|
55
|
+
|
56
|
+
- Support other job types
|
57
|
+
- Allow for configuring the job class name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paper_trail-background
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurtis Rainbolt-Greene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|