good_job 2.9.1 → 2.9.2
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/CHANGELOG.md +19 -4
- data/README.md +9 -4
- data/lib/good_job/filterable.rb +11 -2
- data/lib/good_job/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: 43a641edf5b6ff33dc8752874c6b317ad96bfd74ed4cbcb3a9bbeee7ff9c14cf
|
|
4
|
+
data.tar.gz: bfcf81a0d6c2d7bef01c3abdad9222fcc92cc8a5fd0ead3059fe5b9afd96aefa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea801613572d4ccdce2af524303220eed9f50532ce80160c8fd9063bb994f0be725cf806d84aad8ea2bf5028f593a79fa13b5d1f7e796ece29eee70d42df9fa8
|
|
7
|
+
data.tar.gz: 9344d31ec8ffacdaa531a7e8bb7292270b151ad440d9dd95cd7ebfbe4106ca6b276ec3cff671df2ad97c9aee50892d453b584f948a7fc5e1bf7710fd935b2d40
|
data/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v2.9.2](https://github.com/bensheldon/good_job/tree/v2.9.2) (2022-01-19)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.9.1...v2.9.2)
|
|
6
|
+
|
|
7
|
+
**Fixed bugs:**
|
|
8
|
+
|
|
9
|
+
- Error on GJ admin UI search form [\#487](https://github.com/bensheldon/good_job/issues/487)
|
|
10
|
+
- Use `websearch_to_tsquery` or \(`plainto_tsquery` for Postgres \< v11\) for Dashboard search filter [\#488](https://github.com/bensheldon/good_job/pull/488) ([bensheldon](https://github.com/bensheldon))
|
|
11
|
+
|
|
12
|
+
**Merged pull requests:**
|
|
13
|
+
|
|
14
|
+
- Update README to illustrate using named arguments for the unique key. [\#486](https://github.com/bensheldon/good_job/pull/486) ([phallstrom](https://github.com/phallstrom))
|
|
15
|
+
- Add details about exactly where to require the engine. [\#485](https://github.com/bensheldon/good_job/pull/485) ([phallstrom](https://github.com/phallstrom))
|
|
16
|
+
- $ symbol gets copied when clicking on the copy button [\#484](https://github.com/bensheldon/good_job/pull/484) ([zeevy](https://github.com/zeevy))
|
|
17
|
+
|
|
3
18
|
## [v2.9.1](https://github.com/bensheldon/good_job/tree/v2.9.1) (2022-01-13)
|
|
4
19
|
|
|
5
20
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.9.0...v2.9.1)
|
|
6
21
|
|
|
22
|
+
**Fixed bugs:**
|
|
23
|
+
|
|
24
|
+
- Start async adapters once `ActiveRecord` and `ActiveJob` have loaded, potentially before `Rails.application.initialized?` [\#483](https://github.com/bensheldon/good_job/pull/483) ([bensheldon](https://github.com/bensheldon))
|
|
25
|
+
|
|
7
26
|
**Closed issues:**
|
|
8
27
|
|
|
9
28
|
- Graceful fallback to polling when LISTEN/NOTIFY isn't available [\#482](https://github.com/bensheldon/good_job/issues/482)
|
|
10
29
|
- Long running locks on latest good job [\#480](https://github.com/bensheldon/good_job/issues/480)
|
|
11
30
|
|
|
12
|
-
**Merged pull requests:**
|
|
13
|
-
|
|
14
|
-
- Start async adapters once `ActiveRecord` and `ActiveJob` have loaded, potentially before `Rails.application.initialized?` [\#483](https://github.com/bensheldon/good_job/pull/483) ([bensheldon](https://github.com/bensheldon))
|
|
15
|
-
|
|
16
31
|
## [v2.9.0](https://github.com/bensheldon/good_job/tree/v2.9.0) (2022-01-09)
|
|
17
32
|
|
|
18
33
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.8.1...v2.9.0)
|
data/README.md
CHANGED
|
@@ -73,19 +73,19 @@ For more of the story of GoodJob, read the [introductory blog post](https://isla
|
|
|
73
73
|
1. Install the gem:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
|
|
76
|
+
bundle install
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
1. Run the GoodJob install generator. This will generate a database migration to create a table for GoodJob's job records:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
|
|
82
|
+
bin/rails g good_job:install
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
Run the migration:
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
|
-
|
|
88
|
+
bin/rails db:migrate
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Optional: If using Rails' multiple databases with the `migrations_paths` configuration option, use the `--database` option:
|
|
@@ -328,7 +328,7 @@ _🚧 GoodJob's dashboard is a work in progress. Please contribute ideas and cod
|
|
|
328
328
|
|
|
329
329
|
GoodJob includes a Dashboard as a mountable `Rails::Engine`.
|
|
330
330
|
|
|
331
|
-
1. Explicitly require the Engine code at the top of your `config/application.rb` file, immediately after Rails is required. This is necessary because the mountable engine is an optional feature of GoodJob.
|
|
331
|
+
1. Explicitly require the Engine code at the top of your `config/application.rb` file, immediately after Rails is required and before Bundler requires the Rails' groups. This is necessary because the mountable engine is an optional feature of GoodJob.
|
|
332
332
|
|
|
333
333
|
```ruby
|
|
334
334
|
# config/application.rb
|
|
@@ -339,6 +339,8 @@ GoodJob includes a Dashboard as a mountable `Rails::Engine`.
|
|
|
339
339
|
# ...
|
|
340
340
|
```
|
|
341
341
|
|
|
342
|
+
Note: If you find the dashboard fails to reload due to a routing error and uninitialized constant `GoodJob::ExecutionsController`, this is likely because you are not requiring the engine early enough.
|
|
343
|
+
|
|
342
344
|
1. Mount the engine in your `config/routes.rb` file. The following will mount it at `http://example.com/good_job`.
|
|
343
345
|
|
|
344
346
|
```ruby
|
|
@@ -399,6 +401,9 @@ class MyJob < ApplicationJob
|
|
|
399
401
|
# Can be String or Lambda/Proc that is invoked in the context of the job.
|
|
400
402
|
# Note: Arguments passed to #perform_later must be accessed through `arguments` method.
|
|
401
403
|
key: -> { "Unique-#{arguments.first}" } # MyJob.perform_later("Alice") => "Unique-Alice"
|
|
404
|
+
|
|
405
|
+
# If the method uses named parameters, they can be accessed like so:
|
|
406
|
+
# key: -> { "Unique-#{arguments.first['name']}" } # MyJob.perform_later(name: "Alice")
|
|
402
407
|
)
|
|
403
408
|
|
|
404
409
|
def perform(first_name)
|
data/lib/good_job/filterable.rb
CHANGED
|
@@ -34,9 +34,18 @@ module GoodJob
|
|
|
34
34
|
next if query.blank?
|
|
35
35
|
|
|
36
36
|
tsvector = "(to_tsvector('english', serialized_params) || to_tsvector('english', id::text) || to_tsvector('english', COALESCE(error, '')::text))"
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
to_tsquery_function = database_supports_websearch_to_tsquery? ? 'websearch_to_tsquery' : 'plainto_tsquery'
|
|
38
|
+
where("#{tsvector} @@ #{to_tsquery_function}(?)", query)
|
|
39
|
+
.order(sanitize_sql_for_order([Arel.sql("ts_rank(#{tsvector}, #{to_tsquery_function}(?))"), query]) => 'DESC')
|
|
39
40
|
end)
|
|
40
41
|
end
|
|
42
|
+
|
|
43
|
+
class_methods do
|
|
44
|
+
def database_supports_websearch_to_tsquery?
|
|
45
|
+
return @_database_supports_websearch_to_tsquery if defined?(@_database_supports_websearch_to_tsquery)
|
|
46
|
+
|
|
47
|
+
@_database_supports_websearch_to_tsquery = connection.postgresql_version >= 110000
|
|
48
|
+
end
|
|
49
|
+
end
|
|
41
50
|
end
|
|
42
51
|
end
|
data/lib/good_job/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: good_job
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.9.
|
|
4
|
+
version: 2.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Sheldon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-01-
|
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activejob
|