active_job_reporter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -23
- data/lib/active_job_reporter/configuration.rb +0 -4
- data/lib/active_job_reporter/job_concern.rb +1 -1
- data/lib/active_job_reporter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caece8a3f6de84e9cc166d232f85e0a95900d514
|
4
|
+
data.tar.gz: 975b539144f1710e34378d6063032a14ffe13cf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77e7ac0ff8a3616084311f166a94d6a345a6ba72d1d06bde666457ffb56c6f37961f720172d2511fb27ab2b41a0f827b187768dd6f712fb04de922b34433942d
|
7
|
+
data.tar.gz: 29070fde2aeb7ff394c9494615a290e26bdb1f0937d98420bd59c0163125190e5b1285e81929dcb0e28e3fe805d586b828a251b9e4c4c60503938dcb02dc67f0
|
data/README.md
CHANGED
@@ -12,6 +12,28 @@ Monitoring and reporting for ActiveJob.
|
|
12
12
|
* Automatic basic exception handling during errors.
|
13
13
|
* Allows to override built-in Job model.
|
14
14
|
|
15
|
+
## Installation
|
16
|
+
1. Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'active_job_reporter'
|
20
|
+
```
|
21
|
+
|
22
|
+
2. Update bundle
|
23
|
+
|
24
|
+
```bash
|
25
|
+
$ bundle
|
26
|
+
```
|
27
|
+
|
28
|
+
3. Run installer
|
29
|
+
|
30
|
+
Add `jobs`, `job_objects` and `job_messages` tables to your database and an initializer file for configuration:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
$ bundle exec rails generate active_job_reporter:install
|
34
|
+
$ bundle exec rake db:migrate
|
35
|
+
```
|
36
|
+
|
15
37
|
## Usage
|
16
38
|
|
17
39
|
1. Add `ReportableJob` concern to your jobs. You can add to `ApplicationJob` to avoid adding to every job. Jobs will be tracked automatically.
|
@@ -32,7 +54,10 @@ end
|
|
32
54
|
|
33
55
|
```ruby
|
34
56
|
def related_objects
|
35
|
-
[
|
57
|
+
[
|
58
|
+
arguments.first&.fetch(:order, nil),
|
59
|
+
*arguments.first&.fetch(:items, [])
|
60
|
+
].compact
|
36
61
|
end
|
37
62
|
```
|
38
63
|
|
@@ -83,35 +108,17 @@ ActiveJobReporter.configure do |config|
|
|
83
108
|
...
|
84
109
|
|
85
110
|
# The class name for jobs
|
86
|
-
config.
|
111
|
+
config.job_class_name = "Job"
|
87
112
|
|
88
113
|
...
|
89
114
|
end
|
90
115
|
```
|
91
116
|
|
92
|
-
##
|
93
|
-
1. Add this line to your application's Gemfile:
|
94
|
-
|
95
|
-
```ruby
|
96
|
-
gem 'active_job_reporter'
|
97
|
-
```
|
98
|
-
|
99
|
-
2. Update bundle
|
100
|
-
|
101
|
-
```bash
|
102
|
-
$ bundle
|
103
|
-
```
|
104
|
-
|
105
|
-
3. Run installer
|
117
|
+
## Changelog
|
106
118
|
|
107
|
-
|
119
|
+
#### 0.1.1
|
108
120
|
|
109
|
-
|
110
|
-
$ bundle exec rails generate active_job_reporter:install
|
111
|
-
$ bundle exec rake db:migrate
|
112
|
-
```
|
113
|
-
|
114
|
-
## Changelog
|
121
|
+
* Fixed deprecated use of class instead of class name in `belongs_to`.
|
115
122
|
|
116
123
|
#### 0.1.0
|
117
124
|
|
@@ -17,7 +17,7 @@ module ActiveJobReporter
|
|
17
17
|
|
18
18
|
has_many :messages, foreign_key: "job_id", class_name: "ActiveJobReporter::JobMessage"
|
19
19
|
|
20
|
-
belongs_to :user, class_name: ActiveJobReporter.configuration.
|
20
|
+
belongs_to :user, class_name: ActiveJobReporter.configuration.user_class_name, optional: true
|
21
21
|
end
|
22
22
|
|
23
23
|
def add_message(type:, message:)
|