worker_plugins 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/worker_plugins/workplace.rb +4 -4
- 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 +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9169da6dfadfccf39b65f247a728885152daebeef7470ea77e1ed1bd381e091b
|
4
|
+
data.tar.gz: c8e77a446274d1fe6a37c1ad5ffae3450bb7819eafad511d658b7eb609dd103a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0244c00a1c87707a1553815f9f871f8a5309c53123dc67788a8e5ccfde9ee7a5f72d88c075c7290d40ec10533accd129c354afee1bd8e3e13ac12c61fd22b659
|
7
|
+
data.tar.gz: a5d95d70f694b93c123ae85ec8b42a71e751394011c16bb1a3a577c163e796bd4a91ffc453ae201db9fa4ecd4cf2f00c785f58af8e731116a1ac56591a4efae1
|
@@ -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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Kasper
|
8
|
-
autorequire:
|
7
|
+
- Kasper Stöckel
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-02 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
|
+
- k@spernj.org
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
@@ -48,7 +48,7 @@ homepage: https://www.github.com/kaspernj/worker_plugins
|
|
48
48
|
licenses: []
|
49
49
|
metadata:
|
50
50
|
rubygems_mfa_required: 'true'
|
51
|
-
post_install_message:
|
51
|
+
post_install_message:
|
52
52
|
rdoc_options: []
|
53
53
|
require_paths:
|
54
54
|
- lib
|
@@ -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
|
- - ">="
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
66
|
rubygems_version: 3.4.10
|
67
|
-
signing_key:
|
67
|
+
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: Rails framework for easily choosing and creating lists of objects and execute
|
70
70
|
plugins against them.
|