worker_plugins 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +6 -1
- data/Rakefile +12 -12
- data/app/models/worker_plugins/workplace.rb +15 -45
- data/app/models/worker_plugins/workplace_link.rb +5 -2
- data/app/services/worker_plugins/add_collection.rb +99 -0
- data/app/services/worker_plugins/application_service.rb +25 -0
- data/app/services/worker_plugins/remove_collection.rb +31 -0
- data/app/services/worker_plugins/select_column_with_type_cast.rb +43 -0
- data/app/services/worker_plugins/switch_collection.rb +54 -0
- data/db/migrate/20150521114555_create_worker_plugins_workplaces.rb +4 -7
- data/db/migrate/20150521114659_create_worker_plugins_workplace_links.rb +16 -6
- data/db/migrate/20200702072306_change_workplace_links_resource_id_to_string_to_support_uuids.rb +5 -0
- data/db/migrate/20210106190349_change_resource_id_to_string_to_support_uuid.rb +5 -0
- data/lib/worker_plugins/engine.rb +6 -12
- data/lib/worker_plugins/version.rb +1 -1
- data/lib/worker_plugins.rb +2 -1
- metadata +91 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0200fe1c8fd8d1618539ea3306191456ec929cd8f6e70ae2fb707f9ba79d314f
|
4
|
+
data.tar.gz: 1d78c88a6aabfa667bf9d7f8533a52dfb12c3edfe9908c45da97fc85e4234d79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9b8c48f468ddd91c47b784472a87f860e98982ec7aba4674cf701395ce8ea27434e1c2de115d3f6033268930a6ed30c4d8a69953b82707b5b66d0780ae2fbdf
|
7
|
+
data.tar.gz: c1d0d739c588beacb9aa44c44ff627f7ad838546d39ccceef936022babf539d7fe57819294ae2becaa416da26f0cef47651901667e02964b8e470c4c6df9111c
|
data/README.md
CHANGED
@@ -7,6 +7,11 @@ Add to your Gemfile and bundle:
|
|
7
7
|
gem 'worker_plugins'
|
8
8
|
```
|
9
9
|
|
10
|
+
Install migrations (only necessary sometimes - try running `rails db:migrate` first before installing migrations):
|
11
|
+
```bash
|
12
|
+
rails worker_plugins:install:migrations
|
13
|
+
```
|
14
|
+
|
10
15
|
## Usage
|
11
16
|
|
12
17
|
Add a lot of objects to a workspace through transactions:
|
@@ -24,4 +29,4 @@ workspace.each_resource(types: ['User']) do |user|
|
|
24
29
|
|
25
30
|
## License
|
26
31
|
|
27
|
-
This project rocks and uses MIT-LICENSE.
|
32
|
+
This project rocks and uses MIT-LICENSE.
|
data/Rakefile
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
begin
|
3
|
-
require
|
3
|
+
require "bundler/setup"
|
4
4
|
rescue LoadError
|
5
|
-
puts
|
5
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
6
6
|
end
|
7
7
|
begin
|
8
|
-
require
|
8
|
+
require "rdoc/task"
|
9
9
|
rescue LoadError
|
10
|
-
require
|
11
|
-
require
|
10
|
+
require "rdoc/rdoc"
|
11
|
+
require "rake/rdoctask"
|
12
12
|
RDoc::Task = Rake::RDocTask
|
13
13
|
end
|
14
14
|
|
15
15
|
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
-
rdoc.rdoc_dir =
|
17
|
-
rdoc.title =
|
18
|
-
rdoc.options <<
|
19
|
-
rdoc.rdoc_files.include(
|
20
|
-
rdoc.rdoc_files.include(
|
16
|
+
rdoc.rdoc_dir = "rdoc"
|
17
|
+
rdoc.title = "WorkerPlugins"
|
18
|
+
rdoc.options << "--line-numbers"
|
19
|
+
rdoc.rdoc_files.include("README.rdoc")
|
20
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
21
21
|
end
|
22
22
|
|
23
|
-
APP_RAKEFILE = File.expand_path("
|
24
|
-
load
|
23
|
+
APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
|
24
|
+
load "rails/tasks/engine.rake"
|
25
25
|
|
26
26
|
Bundler::GemHelper.install_tasks
|
@@ -1,58 +1,28 @@
|
|
1
|
-
class WorkerPlugins::Workplace < ActiveRecord::Base
|
1
|
+
class WorkerPlugins::Workplace < ActiveRecord::Base # rubocop:disable Rails/ApplicationRecord
|
2
|
+
self.table_name = "worker_plugins_workplaces"
|
3
|
+
|
2
4
|
has_many :workplace_links, dependent: :destroy
|
3
5
|
|
4
6
|
belongs_to :user, polymorphic: true
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
def add_links_to_objects(objects)
|
9
|
-
require 'active-record-transactioner'
|
10
|
-
|
11
|
-
# Cache inserted objects.
|
12
|
-
inserted_ids = load_inserted_ids
|
13
|
-
|
14
|
-
# Add given objects through transactions.
|
15
|
-
ActiveRecordTransactioner.new do |trans|
|
16
|
-
stream_each(objects) do |object|
|
17
|
-
class_name = object.class.name.to_s
|
18
|
-
inserted_ids[class_name] ||= {}
|
19
|
-
|
20
|
-
unless inserted_ids[class_name].key?(object.id)
|
21
|
-
inserted_ids[class_name][object.id] = true
|
22
|
-
link = WorkerPlugins::WorkplaceLink.new(
|
23
|
-
workplace: self,
|
24
|
-
resource: object
|
25
|
-
)
|
26
|
-
trans.save!(link)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
8
|
+
validates :name, presence: true
|
30
9
|
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
def each_resource(args = {})
|
10
|
+
def each_resource(limit: nil, types: nil)
|
35
11
|
count = 0
|
36
12
|
|
37
|
-
links_query = workplace_links.
|
38
|
-
links_query = links_query.where(resource_type:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
ids.each_slice(500) do |ids_slice|
|
45
|
-
constant.where(id: ids_slice).each do |resource|
|
46
|
-
yield resource
|
47
|
-
count += 1
|
48
|
-
return if args[:limit] && count >= args[:limit]
|
49
|
-
end
|
13
|
+
links_query = workplace_links.order(:id)
|
14
|
+
links_query = links_query.where(resource_type: types) if types
|
15
|
+
links_query.find_in_batches do |workplace_links|
|
16
|
+
workplace_links.each do |workplace_link|
|
17
|
+
yield workplace_link.resource
|
18
|
+
count += 1
|
19
|
+
return if limit && count >= limit # rubocop:disable Lint/NonLocalExitFromIterator:
|
50
20
|
end
|
51
21
|
end
|
52
22
|
end
|
53
23
|
|
54
24
|
def each_query_for_resources
|
55
|
-
workplace_links.group(
|
25
|
+
workplace_links.group("worker_plugins_workplace_links.resource_type").order("worker_plugins_workplace_links.id").each do |workplace_link|
|
56
26
|
resource_type = workplace_link.resource_type
|
57
27
|
constant = Object.const_get(resource_type)
|
58
28
|
ids = workplace_links.select(:resource_id).where(resource_type: workplace_link.resource_type).map(&:resource_id)
|
@@ -82,11 +52,11 @@ private
|
|
82
52
|
def load_inserted_ids
|
83
53
|
inserted_ids = {}
|
84
54
|
|
85
|
-
workplace_links.select(
|
55
|
+
workplace_links.select(:id, :resource_type, :resource_id).find_each do |workplace_link|
|
86
56
|
inserted_ids[workplace_link.resource_type] ||= {}
|
87
57
|
inserted_ids[workplace_link.resource_type][workplace_link.resource_id] = true
|
88
58
|
end
|
89
59
|
|
90
|
-
|
60
|
+
inserted_ids
|
91
61
|
end
|
92
62
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
-
class WorkerPlugins::WorkplaceLink < ActiveRecord::Base
|
1
|
+
class WorkerPlugins::WorkplaceLink < ActiveRecord::Base # rubocop:disable Rails/ApplicationRecord
|
2
|
+
self.table_name = "worker_plugins_workplace_links"
|
3
|
+
|
2
4
|
belongs_to :workplace
|
3
5
|
belongs_to :resource, polymorphic: true
|
4
6
|
|
5
|
-
|
7
|
+
validates :workplace, :resource, presence: true
|
8
|
+
validates :resource_id, uniqueness: {scope: [:resource_type, :workplace_id]}
|
6
9
|
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
class WorkerPlugins::AddCollection < WorkerPlugins::ApplicationService
|
2
|
+
attr_reader :query, :workplace
|
3
|
+
|
4
|
+
def initialize(query:, workplace:)
|
5
|
+
@query = query
|
6
|
+
.except(:order) # This fixes crashes in Postgres
|
7
|
+
@workplace = workplace
|
8
|
+
end
|
9
|
+
|
10
|
+
def perform
|
11
|
+
created # Cache which are about to be created
|
12
|
+
add_query_to_workplace
|
13
|
+
succeed!(created: created)
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_query_to_workplace
|
17
|
+
WorkerPlugins::WorkplaceLink.connection.execute(sql)
|
18
|
+
end
|
19
|
+
|
20
|
+
def created
|
21
|
+
@created ||= resources_to_add.pluck(primary_key.to_sym)
|
22
|
+
end
|
23
|
+
|
24
|
+
def ids_added_already_query
|
25
|
+
workplace
|
26
|
+
.workplace_links
|
27
|
+
.where(resource_type: model_class.name, resource_id: query_with_selected_ids)
|
28
|
+
end
|
29
|
+
|
30
|
+
def ids_added_already
|
31
|
+
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
32
|
+
column_name_to_select: :resource_id,
|
33
|
+
column_to_compare_with: model_class.column_for_attribute(:id),
|
34
|
+
query: ids_added_already_query
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def model_class
|
39
|
+
@model_class ||= query.klass
|
40
|
+
end
|
41
|
+
|
42
|
+
def primary_key
|
43
|
+
@primary_key ||= resources_to_add.klass.primary_key
|
44
|
+
end
|
45
|
+
|
46
|
+
def query_with_selected_ids
|
47
|
+
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
48
|
+
column_name_to_select: :id,
|
49
|
+
column_to_compare_with: WorkerPlugins::WorkplaceLink.column_for_attribute(:resource_id),
|
50
|
+
query: query
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
def resources_to_add
|
55
|
+
@resources_to_add ||= query
|
56
|
+
.distinct
|
57
|
+
.where
|
58
|
+
.not(id: ids_added_already)
|
59
|
+
end
|
60
|
+
|
61
|
+
def select_sql
|
62
|
+
@select_sql ||= resources_to_add
|
63
|
+
.select("
|
64
|
+
#{db_now_value},
|
65
|
+
#{quote(resources_to_add.klass.name)},
|
66
|
+
\"#{resources_to_add.klass.table_name}\".\"#{primary_key}\",
|
67
|
+
#{db_now_value},
|
68
|
+
#{select_workplace_id_sql}
|
69
|
+
")
|
70
|
+
.to_sql
|
71
|
+
end
|
72
|
+
|
73
|
+
def select_workplace_id_sql
|
74
|
+
workplace_id_column = WorkerPlugins::WorkplaceLink.columns.find { |column| column.name == "workplace_id" }
|
75
|
+
|
76
|
+
if workplace_id_column.type == :uuid
|
77
|
+
"CAST(#{quote(workplace.id)} AS UUID)"
|
78
|
+
else
|
79
|
+
quote(workplace.id)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def sql
|
84
|
+
@sql ||= "
|
85
|
+
INSERT INTO
|
86
|
+
worker_plugins_workplace_links
|
87
|
+
|
88
|
+
(
|
89
|
+
created_at,
|
90
|
+
resource_type,
|
91
|
+
resource_id,
|
92
|
+
updated_at,
|
93
|
+
workplace_id
|
94
|
+
)
|
95
|
+
|
96
|
+
#{select_sql}
|
97
|
+
"
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class WorkerPlugins::ApplicationService < ServicePattern::Service
|
2
|
+
def db_now_value
|
3
|
+
@db_now_value ||= begin
|
4
|
+
time_string = Time.zone.now.strftime("%Y-%m-%d %H:%M:%S")
|
5
|
+
|
6
|
+
if postgres?
|
7
|
+
"CAST(#{quote(time_string)} AS TIMESTAMP)"
|
8
|
+
else
|
9
|
+
quote(time_string)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def quote(value)
|
15
|
+
WorkerPlugins::Workplace.connection.quote(value)
|
16
|
+
end
|
17
|
+
|
18
|
+
def postgres?
|
19
|
+
ActiveRecord::Base.connection.instance_values["config"][:adapter].downcase.include?("postgres")
|
20
|
+
end
|
21
|
+
|
22
|
+
def sqlite?
|
23
|
+
ActiveRecord::Base.connection.instance_values["config"][:adapter].downcase.include?("sqlite")
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class WorkerPlugins::RemoveCollection < WorkerPlugins::ApplicationService
|
2
|
+
attr_reader :destroyed, :query, :workplace
|
3
|
+
|
4
|
+
def initialize(query:, workplace:)
|
5
|
+
@query = query
|
6
|
+
@workplace = workplace
|
7
|
+
end
|
8
|
+
|
9
|
+
def perform
|
10
|
+
remove_query_from_workplace
|
11
|
+
succeed!(destroyed: destroyed, mode: :destroyed)
|
12
|
+
end
|
13
|
+
|
14
|
+
def remove_query_from_workplace
|
15
|
+
links_query = workplace.workplace_links.where(resource_type: model_class.name, resource_id: query_with_selected_ids)
|
16
|
+
@destroyed = links_query.pluck(:resource_id)
|
17
|
+
links_query.delete_all
|
18
|
+
end
|
19
|
+
|
20
|
+
def model_class
|
21
|
+
query.klass
|
22
|
+
end
|
23
|
+
|
24
|
+
def query_with_selected_ids
|
25
|
+
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
26
|
+
column_name_to_select: :id,
|
27
|
+
column_to_compare_with: WorkerPlugins::WorkplaceLink.column_for_attribute(:resource_id),
|
28
|
+
query: query
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class WorkerPlugins::SelectColumnWithTypeCast < WorkerPlugins::ApplicationService
|
2
|
+
attr_reader :column_name_to_select, :column_to_compare_with, :query
|
3
|
+
|
4
|
+
def initialize(column_name_to_select:, column_to_compare_with:, query:)
|
5
|
+
@column_name_to_select = column_name_to_select
|
6
|
+
@column_to_compare_with = column_to_compare_with
|
7
|
+
@query = query
|
8
|
+
end
|
9
|
+
|
10
|
+
def perform
|
11
|
+
return succeed! query.select(column_name_to_select) if same_type?
|
12
|
+
|
13
|
+
if column_to_compare_with.type == :string
|
14
|
+
succeed! query_with_varchar
|
15
|
+
elsif column_to_compare_with.type == :integer
|
16
|
+
succeed! query_with_integer
|
17
|
+
else
|
18
|
+
raise "Cant handle type cast between types: " \
|
19
|
+
"#{model_class.table_name}.#{column_name_to_select} (#{column_to_select.type}) " \
|
20
|
+
"#{column_to_compare_with.name} (#{column_to_compare_with.type})"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def column_to_select
|
25
|
+
@column_to_select ||= model_class.column_for_attribute(column_name_to_select)
|
26
|
+
end
|
27
|
+
|
28
|
+
def model_class
|
29
|
+
@model_class ||= query.klass
|
30
|
+
end
|
31
|
+
|
32
|
+
def query_with_integer
|
33
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS BIGINT)")
|
34
|
+
end
|
35
|
+
|
36
|
+
def query_with_varchar
|
37
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS VARCHAR)")
|
38
|
+
end
|
39
|
+
|
40
|
+
def same_type?
|
41
|
+
column_to_select.type == column_to_compare_with.type
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class WorkerPlugins::SwitchCollection < WorkerPlugins::ApplicationService
|
2
|
+
attr_reader :query, :workplace
|
3
|
+
|
4
|
+
def initialize(query:, workplace:)
|
5
|
+
@query = query
|
6
|
+
@workplace = workplace
|
7
|
+
end
|
8
|
+
|
9
|
+
def perform
|
10
|
+
if resources_to_add.count.zero?
|
11
|
+
result = WorkerPlugins::RemoveCollection.execute!(query: query, workplace: workplace)
|
12
|
+
succeed!(
|
13
|
+
destroyed: result.fetch(:destroyed),
|
14
|
+
mode: :destroyed
|
15
|
+
)
|
16
|
+
else
|
17
|
+
result = WorkerPlugins::AddCollection.execute!(query: query, workplace: workplace)
|
18
|
+
succeed!(
|
19
|
+
created: result.fetch(:created),
|
20
|
+
mode: :created
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def ids_added_already_query
|
26
|
+
workplace
|
27
|
+
.workplace_links
|
28
|
+
.where(resource_type: model_class.name, resource_id: query_with_selected_ids)
|
29
|
+
end
|
30
|
+
|
31
|
+
def ids_added_already
|
32
|
+
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
33
|
+
column_name_to_select: :resource_id,
|
34
|
+
column_to_compare_with: model_class.column_for_attribute(:id),
|
35
|
+
query: ids_added_already_query
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def model_class
|
40
|
+
@model_class ||= query.klass
|
41
|
+
end
|
42
|
+
|
43
|
+
def query_with_selected_ids
|
44
|
+
WorkerPlugins::SelectColumnWithTypeCast.execute!(
|
45
|
+
column_name_to_select: :id,
|
46
|
+
column_to_compare_with: WorkerPlugins::WorkplaceLink.column_for_attribute(:resource_id),
|
47
|
+
query: query
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
def resources_to_add
|
52
|
+
@resources_to_add ||= query.where.not(id: ids_added_already)
|
53
|
+
end
|
54
|
+
end
|
@@ -1,13 +1,10 @@
|
|
1
|
-
class CreateWorkerPluginsWorkplaces < ActiveRecord::Migration
|
1
|
+
class CreateWorkerPluginsWorkplaces < ActiveRecord::Migration[5.2]
|
2
2
|
def change
|
3
3
|
create_table :worker_plugins_workplaces do |t|
|
4
|
-
t.string :name
|
5
|
-
t.boolean :active
|
6
|
-
t.belongs_to :user, polymorphic: true
|
4
|
+
t.string :name, null: false
|
5
|
+
t.boolean :active, default: false, index: true, null: false
|
6
|
+
t.belongs_to :user, index: true, polymorphic: true
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
|
10
|
-
add_index :worker_plugins_workplaces, :user_id
|
11
|
-
add_index :worker_plugins_workplaces, :active
|
12
9
|
end
|
13
10
|
end
|
@@ -1,13 +1,23 @@
|
|
1
|
-
class CreateWorkerPluginsWorkplaceLinks < ActiveRecord::Migration
|
1
|
+
class CreateWorkerPluginsWorkplaceLinks < ActiveRecord::Migration[5.2]
|
2
2
|
def change
|
3
3
|
create_table :worker_plugins_workplace_links do |t|
|
4
|
-
t.
|
5
|
-
t.belongs_to :resource, polymorphic: true
|
6
|
-
|
4
|
+
t.references :workplace, index: {name: "index_on_workplace_id"}, null: false
|
5
|
+
t.belongs_to :resource, index: {name: "index_on_resource"}, null: false, polymorphic: true
|
6
|
+
|
7
|
+
if postgres?
|
8
|
+
t.jsonb :custom_data
|
9
|
+
else
|
10
|
+
t.json :custom_data
|
11
|
+
end
|
12
|
+
|
7
13
|
t.timestamps
|
8
14
|
end
|
9
15
|
|
10
|
-
add_index :worker_plugins_workplace_links, :workplace_id
|
11
|
-
|
16
|
+
add_index :worker_plugins_workplace_links, [:workplace_id, :resource_type, :resource_id], unique: true, name: "unique_resource_on_workspace"
|
17
|
+
add_foreign_key :worker_plugins_workplace_links, :worker_plugins_workplaces, column: "workplace_id"
|
18
|
+
end
|
19
|
+
|
20
|
+
def postgres?
|
21
|
+
connection.adapter_name.downcase.include?("postgres")
|
12
22
|
end
|
13
23
|
end
|
@@ -1,15 +1,9 @@
|
|
1
|
-
module WorkerPlugins
|
2
|
-
class Engine < ::Rails::Engine
|
3
|
-
isolate_namespace WorkerPlugins
|
1
|
+
module WorkerPlugins; end
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
I18n.load_path += Dir[File.join(path, '**', '*.{rb,yml}')]
|
3
|
+
class WorkerPlugins::Engine < ::Rails::Engine
|
4
|
+
isolate_namespace WorkerPlugins
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
6
|
+
# Add translations to load path.
|
7
|
+
path = File.realpath(File.join(File.dirname(__FILE__), "..", "..", "config", "locales"))
|
8
|
+
I18n.load_path += Dir[File.join(path, "**", "*.{rb,yml}")]
|
15
9
|
end
|
data/lib/worker_plugins.rb
CHANGED
metadata
CHANGED
@@ -1,45 +1,73 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johanmsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: service_pattern
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: awesome_translations
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: factory_bot_rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-rails
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
73
|
- - ">="
|
@@ -67,7 +95,7 @@ dependencies:
|
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
98
|
+
name: rubocop
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - ">="
|
@@ -81,7 +109,49 @@ dependencies:
|
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
112
|
+
name: rubocop-performance
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-rails
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: sqlite3
|
85
155
|
requirement: !ruby/object:Gem::Requirement
|
86
156
|
requirements:
|
87
157
|
- - ">="
|
@@ -97,7 +167,7 @@ dependencies:
|
|
97
167
|
description: Rails framework for easily choosing and creating lists of objects and
|
98
168
|
execute plugins against them.
|
99
169
|
email:
|
100
|
-
-
|
170
|
+
- kaspernj@gmail.com
|
101
171
|
executables: []
|
102
172
|
extensions: []
|
103
173
|
extra_rdoc_files: []
|
@@ -107,6 +177,11 @@ files:
|
|
107
177
|
- Rakefile
|
108
178
|
- app/models/worker_plugins/workplace.rb
|
109
179
|
- app/models/worker_plugins/workplace_link.rb
|
180
|
+
- app/services/worker_plugins/add_collection.rb
|
181
|
+
- app/services/worker_plugins/application_service.rb
|
182
|
+
- app/services/worker_plugins/remove_collection.rb
|
183
|
+
- app/services/worker_plugins/select_column_with_type_cast.rb
|
184
|
+
- app/services/worker_plugins/switch_collection.rb
|
110
185
|
- config/locales/awesome_translations/models/worker_plugins__workplace/da.yml
|
111
186
|
- config/locales/awesome_translations/models/worker_plugins__workplace/en.yml
|
112
187
|
- config/locales/awesome_translations/models/worker_plugins__workplace_link/da.yml
|
@@ -114,6 +189,8 @@ files:
|
|
114
189
|
- config/routes.rb
|
115
190
|
- db/migrate/20150521114555_create_worker_plugins_workplaces.rb
|
116
191
|
- db/migrate/20150521114659_create_worker_plugins_workplace_links.rb
|
192
|
+
- db/migrate/20200702072306_change_workplace_links_resource_id_to_string_to_support_uuids.rb
|
193
|
+
- db/migrate/20210106190349_change_resource_id_to_string_to_support_uuid.rb
|
117
194
|
- lib/tasks/worker_plugins_tasks.rake
|
118
195
|
- lib/worker_plugins.rb
|
119
196
|
- lib/worker_plugins/engine.rb
|
@@ -129,15 +206,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
206
|
requirements:
|
130
207
|
- - ">="
|
131
208
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
209
|
+
version: 2.5.7
|
133
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
211
|
requirements:
|
135
212
|
- - ">="
|
136
213
|
- !ruby/object:Gem::Version
|
137
214
|
version: '0'
|
138
215
|
requirements: []
|
139
|
-
|
140
|
-
rubygems_version: 2.4.0
|
216
|
+
rubygems_version: 3.1.6
|
141
217
|
signing_key:
|
142
218
|
specification_version: 4
|
143
219
|
summary: Rails framework for easily choosing and creating lists of objects and execute
|