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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c09df3f74f6e36b4c812e7376ec9bf582453caa
4
- data.tar.gz: 55e742befd0eac0b6c685da7a3da7d60dc5145e3
3
+ metadata.gz: caece8a3f6de84e9cc166d232f85e0a95900d514
4
+ data.tar.gz: 975b539144f1710e34378d6063032a14ffe13cf7
5
5
  SHA512:
6
- metadata.gz: 2df2ecb5940484d8e6860fd605f15be109ec48ce2ef506b436b69b0911d310ccd22ec45a8328f8f3f55d9bafa2c5bdba0a46e00e431bef338f1e0b5aa5059106
7
- data.tar.gz: 3d162bdd88acc9684dfe067c03a91c6718b9981f38de4c60edff56cdfc064837905229f6b1d71459a35039856117265f68c835ea4d895e0864c163ccc1c4f4c6
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
- [ arguments.first&.fetch(:order, nil), *arguments.first&.fetch(:items, []) ].compact
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.jobs_class_name = "Job"
111
+ config.job_class_name = "Job"
87
112
 
88
113
  ...
89
114
  end
90
115
  ```
91
116
 
92
- ## Installation
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
- Add `jobs`, `job_objects` and `job_messages` tables to your database and an initializer file for configuration:
119
+ #### 0.1.1
108
120
 
109
- ```bash
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
 
@@ -3,9 +3,5 @@
3
3
  module ActiveJobReporter
4
4
  class Configuration
5
5
  attr_accessor :jobs_table_name, :user_class_name, :job_class_name
6
-
7
- def user_class
8
- @user_class ||= user_class_name.constantize
9
- end
10
6
  end
11
7
  end
@@ -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.user_class, optional: true
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:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveJobReporter
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_job_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Diez