worker_plugins 0.0.8 → 0.0.9
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af3f79b1953081fc07f554cd79338d55ffd761b4ec27783f5129089caca039f3
|
|
4
|
+
data.tar.gz: 6f5db87522e726efd317b146b1c2ea106335a0528a3d3466280dc98fae05f7fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b4921cc75b9cf8c012257840ce1dcca05b8abb9e20c34054b367021c15783bc5b6bf9f49535ae829e3b27c37853f61c90bd6921736f333cec1c91ea05a82c4ad
|
|
7
|
+
data.tar.gz: 949a960c7499c29b97a8cf8c42172510c3813f5020e457e0dcf11247e7fae836880e9226744ac226a9e02f164c24517f53941cafb817205674feb2f8c9302e72
|
|
@@ -3,9 +3,10 @@ class WorkerPlugins::Workplace < WorkerPlugins::ApplicationRecord
|
|
|
3
3
|
|
|
4
4
|
has_many :workplace_links, dependent: :destroy
|
|
5
5
|
|
|
6
|
-
belongs_to :user, polymorphic: WorkerPlugins::UserRelationshipPolymorphic.execute
|
|
6
|
+
belongs_to :user, polymorphic: WorkerPlugins::UserRelationshipPolymorphic.execute!, optional: true
|
|
7
7
|
|
|
8
8
|
validates :name, presence: true
|
|
9
|
+
validate :validate_owner
|
|
9
10
|
|
|
10
11
|
def each_resource(limit: nil, types: nil)
|
|
11
12
|
count = 0
|
|
@@ -59,4 +60,12 @@ private
|
|
|
59
60
|
|
|
60
61
|
inserted_ids
|
|
61
62
|
end
|
|
63
|
+
|
|
64
|
+
def validate_owner
|
|
65
|
+
if user.present? && session_id.present?
|
|
66
|
+
errors.add(:base, "Workplace can't belong to both a user and a session")
|
|
67
|
+
elsif user.blank? && session_id.blank?
|
|
68
|
+
errors.add(:base, "Workplace must belong to a user or a session")
|
|
69
|
+
end
|
|
70
|
+
end
|
|
62
71
|
end
|
|
@@ -2,7 +2,7 @@ class WorkerPlugins::SwitchQuery < WorkerPlugins::ApplicationService
|
|
|
2
2
|
arguments :query, :workplace
|
|
3
3
|
|
|
4
4
|
def perform
|
|
5
|
-
if resources_to_add.
|
|
5
|
+
if resources_to_add.none?
|
|
6
6
|
result = WorkerPlugins::RemoveQuery.execute!(query:, workplace:)
|
|
7
7
|
succeed!(
|
|
8
8
|
destroyed: result.fetch(:destroyed),
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kasper Stöckel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-03-23 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.
|
|
@@ -40,6 +40,7 @@ files:
|
|
|
40
40
|
- db/migrate/20150521114659_create_worker_plugins_workplace_links.rb
|
|
41
41
|
- db/migrate/20200702072306_change_workplace_links_resource_id_to_string_to_support_uuids.rb
|
|
42
42
|
- db/migrate/20210106190349_change_resource_id_to_string_to_support_uuid.rb
|
|
43
|
+
- db/migrate/20260322194625_add_session_id_to_worker_plugins_workplaces.rb
|
|
43
44
|
- lib/tasks/worker_plugins_tasks.rake
|
|
44
45
|
- lib/worker_plugins.rb
|
|
45
46
|
- lib/worker_plugins/engine.rb
|