worker_plugins 0.0.6 → 0.0.8
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/app/models/worker_plugins/workplace.rb +5 -5
- data/app/services/worker_plugins/add_query.rb +2 -2
- data/app/services/worker_plugins/query_links_status.rb +2 -2
- data/app/services/worker_plugins/remove_query.rb +1 -1
- data/app/services/worker_plugins/switch_query.rb +3 -3
- data/app/services/worker_plugins/user_relationship_polymorphic.rb +2 -2
- data/lib/worker_plugins/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e84dd175df29b54e897c3419a3651eaad8720a7448d6b6ae1213e04512257814
|
4
|
+
data.tar.gz: ab7a00dbe5b64bad121b082dab5e21f577070ef64c65cf8e5bc612d348b98f64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f102da30a84f0372d49a97f523587674e1aac79cc7f439e0c9214edcdc52751613d9844efa75baa60e3c2b4c4cc252e219a9a61ad8da56d1204744a2d96e55
|
7
|
+
data.tar.gz: a3f2d50025aa0ea2b4672d222a11c6068f960fe3481c5a3ce5cdbe012817ea34071f67f6626134a6ff1a17f16c228d55bc2d15a0051f968d6ab61006ea9c4388
|
@@ -16,7 +16,7 @@ class WorkerPlugins::Workplace < WorkerPlugins::ApplicationRecord
|
|
16
16
|
workplace_links.each do |workplace_link|
|
17
17
|
yield workplace_link.resource
|
18
18
|
count += 1
|
19
|
-
return if limit && count >= limit # rubocop:disable Lint/NonLocalExitFromIterator
|
19
|
+
return if limit && count >= limit # rubocop:disable Lint/NonLocalExitFromIterator
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -30,7 +30,7 @@ class WorkerPlugins::Workplace < WorkerPlugins::ApplicationRecord
|
|
30
30
|
ids.each_slice(500) do |ids_slice|
|
31
31
|
query = constant.where(id: ids_slice)
|
32
32
|
|
33
|
-
yield(query
|
33
|
+
yield(query:, resource_type:)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -41,11 +41,11 @@ class WorkerPlugins::Workplace < WorkerPlugins::ApplicationRecord
|
|
41
41
|
|
42
42
|
private
|
43
43
|
|
44
|
-
def stream_each(list, &
|
44
|
+
def stream_each(list, &)
|
45
45
|
if list.respond_to?(:find_each)
|
46
|
-
list.find_each(&
|
46
|
+
list.find_each(&)
|
47
47
|
else
|
48
|
-
list.each(&
|
48
|
+
list.each(&)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -10,7 +10,7 @@ class WorkerPlugins::AddQuery < WorkerPlugins::ApplicationService
|
|
10
10
|
def perform
|
11
11
|
created # Cache which are about to be created
|
12
12
|
add_query_to_workplace
|
13
|
-
succeed!(created:
|
13
|
+
succeed!(created:)
|
14
14
|
end
|
15
15
|
|
16
16
|
def add_query_to_workplace
|
@@ -47,7 +47,7 @@ class WorkerPlugins::AddQuery < WorkerPlugins::ApplicationService
|
|
47
47
|
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
48
48
|
column_name_to_select: :id,
|
49
49
|
column_to_compare_with: WorkerPlugins::WorkplaceLink.column_for_attribute(:resource_id),
|
50
|
-
query:
|
50
|
+
query:
|
51
51
|
)
|
52
52
|
end
|
53
53
|
|
@@ -11,8 +11,8 @@ class WorkerPlugins::QueryLinksStatus < WorkerPlugins::ApplicationService
|
|
11
11
|
|
12
12
|
succeed!(
|
13
13
|
all_checked: query_count == checked_count,
|
14
|
-
checked_count
|
15
|
-
query_count
|
14
|
+
checked_count:,
|
15
|
+
query_count:,
|
16
16
|
some_checked: checked_count.positive? && checked_count < query_count
|
17
17
|
)
|
18
18
|
end
|
@@ -3,13 +3,13 @@ class WorkerPlugins::SwitchQuery < WorkerPlugins::ApplicationService
|
|
3
3
|
|
4
4
|
def perform
|
5
5
|
if resources_to_add.count.zero?
|
6
|
-
result = WorkerPlugins::RemoveQuery.execute!(query
|
6
|
+
result = WorkerPlugins::RemoveQuery.execute!(query:, workplace:)
|
7
7
|
succeed!(
|
8
8
|
destroyed: result.fetch(:destroyed),
|
9
9
|
mode: :destroyed
|
10
10
|
)
|
11
11
|
else
|
12
|
-
result = WorkerPlugins::AddQuery.execute!(query
|
12
|
+
result = WorkerPlugins::AddQuery.execute!(query:, workplace:)
|
13
13
|
succeed!(
|
14
14
|
created: result.fetch(:created),
|
15
15
|
mode: :created
|
@@ -39,7 +39,7 @@ class WorkerPlugins::SwitchQuery < WorkerPlugins::ApplicationService
|
|
39
39
|
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
40
40
|
column_name_to_select: :id,
|
41
41
|
column_to_compare_with: WorkerPlugins::WorkplaceLink.column_for_attribute(:resource_id),
|
42
|
-
query:
|
42
|
+
query:
|
43
43
|
)
|
44
44
|
end
|
45
45
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class WorkerPlugins::UserRelationshipPolymorphic
|
2
2
|
def self.execute!
|
3
3
|
WorkerPlugins::Workplace.columns_hash.key?("user_type")
|
4
|
-
rescue
|
4
|
+
rescue StandardError => e
|
5
5
|
# Fall back to true if we are in the middle of a migration or something
|
6
|
-
return true if e.message.start_with?("Could not find table")
|
6
|
+
return true if e.message.start_with?("Could not find table") || e.message.match(/Table '(.+)' doesn't exist/)
|
7
7
|
|
8
8
|
raise e
|
9
9
|
end
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worker_plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Kasper
|
7
|
+
- Kasper Stöckel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails framework for easily choosing and creating lists of objects and
|
14
14
|
execute plugins against them.
|
15
15
|
email:
|
16
|
-
-
|
16
|
+
- kasper@diestoeckels.de
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
@@ -56,7 +56,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 2.
|
59
|
+
version: 3.2.2
|
60
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - ">="
|