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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45f9e6adbbcb13324a929a4acae8113a369f940bc737fa7656c7a98f9d4d4c4b
4
- data.tar.gz: fcadd8920cbabc6f9bc183782a65aa3fabbb902dd6e6bcd44ab31ee0bf7e42ef
3
+ metadata.gz: 9169da6dfadfccf39b65f247a728885152daebeef7470ea77e1ed1bd381e091b
4
+ data.tar.gz: c8e77a446274d1fe6a37c1ad5ffae3450bb7819eafad511d658b7eb609dd103a
5
5
  SHA512:
6
- metadata.gz: f758a4bf34e0f0970cab4051e1688883dbf52014cb75303ed91f5d95c387ac8631ee9643df41e07c7fcd75e50726d4be3fd90ac46b7c3ab24c1901f120827009
7
- data.tar.gz: 6f32eb60a99eccb55f3da1881e314a31a5d53e838795482f4e2389afc9e8af1679e41f32eae97aced2c3f2121017b8cbf477a5e53637d2ea2a658b29bc87db91
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: query, resource_type: resource_type)
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, &blk)
44
+ def stream_each(list, &)
45
45
  if list.respond_to?(:find_each)
46
- list.find_each(&blk)
46
+ list.find_each(&)
47
47
  else
48
- list.each(&blk)
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: 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: 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: checked_count,
15
- query_count: query_count,
14
+ checked_count:,
15
+ query_count:,
16
16
  some_checked: checked_count.positive? && checked_count < query_count
17
17
  )
18
18
  end
@@ -5,7 +5,7 @@ class WorkerPlugins::RemoveQuery < WorkerPlugins::ApplicationService
5
5
 
6
6
  def perform
7
7
  remove_query_from_workplace
8
- succeed!(destroyed: destroyed, mode: :destroyed)
8
+ succeed!(destroyed:, mode: :destroyed)
9
9
  end
10
10
 
11
11
  def remove_query_from_workplace
@@ -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: query, workplace: workplace)
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: query, workplace: workplace)
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: 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 ActiveRecord::StatementInvalid => e
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
@@ -1,3 +1,3 @@
1
1
  module WorkerPlugins
2
- VERSION = "0.0.6".freeze
2
+ VERSION = "0.0.7".freeze
3
3
  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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
- - Kasper Johanmsen
8
- autorequire:
7
+ - Kasper Stöckel
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-27 00:00:00.000000000 Z
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
- - kaspernj@gmail.com
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.7.8
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.