legion-data 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop-analysis.yml +28 -0
- data/.github/workflows/sourcehawk-scan.yml +20 -0
- data/.gitignore +5 -2
- data/.rubocop.yml +1 -7
- data/CHANGELOG.md +2 -14
- data/CODE_OF_CONDUCT.md +75 -0
- data/CONTRIBUTING.md +55 -0
- data/Gemfile +7 -1
- data/INDIVIDUAL_CONTRIBUTOR_LICENSE.md +30 -0
- data/LICENSE +201 -0
- data/NOTICE.txt +9 -0
- data/README.md +60 -23
- data/SECURITY.md +9 -0
- data/attribution.txt +1 -0
- data/legion-data.gemspec +22 -35
- data/lib/legion/data.rb +11 -12
- data/lib/legion/data/connection.rb +9 -9
- data/lib/legion/data/migration.rb +0 -0
- data/lib/legion/data/migrations/001_add_schema_columns.rb +0 -0
- data/lib/legion/data/migrations/002_add_nodes.rb +20 -0
- data/lib/legion/data/migrations/003_add_settings.rb +18 -0
- data/lib/legion/data/migrations/004_add_extensions.rb +25 -0
- data/lib/legion/data/migrations/005_add_runners.rb +21 -0
- data/lib/legion/data/migrations/006_add_functions.rb +23 -0
- data/lib/legion/data/migrations/{015_add_default_extensions.rb → 007_add_default_extensions.rb} +1 -0
- data/lib/legion/data/migrations/008_add_tasks.rb +29 -0
- data/lib/legion/data/model.rb +2 -2
- data/lib/legion/data/models/extension.rb +0 -0
- data/lib/legion/data/models/function.rb +2 -4
- data/lib/legion/data/models/node.rb +1 -3
- data/lib/legion/data/models/runner.rb +0 -0
- data/lib/legion/data/models/setting.rb +0 -0
- data/lib/legion/data/models/task.rb +0 -0
- data/lib/legion/data/models/task_log.rb +0 -0
- data/lib/legion/data/settings.rb +20 -20
- data/lib/legion/data/version.rb +1 -1
- data/sourcehawk.yml +4 -0
- metadata +37 -131
- data/.circleci/config.yml +0 -174
- data/.rspec +0 -1
- data/Gemfile.lock +0 -85
- data/Rakefile +0 -55
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/bitbucket-pipelines.yml +0 -26
- data/lib/legion/data/migrations/002_add_users.rb +0 -17
- data/lib/legion/data/migrations/003_add_groups.rb +0 -16
- data/lib/legion/data/migrations/004_add_chains.rb +0 -25
- data/lib/legion/data/migrations/005_add_envs.rb +0 -24
- data/lib/legion/data/migrations/006_add_dcs.rb +0 -24
- data/lib/legion/data/migrations/007_add_nodes.rb +0 -26
- data/lib/legion/data/migrations/008_add_settings.rb +0 -18
- data/lib/legion/data/migrations/009_add_extensions.rb +0 -25
- data/lib/legion/data/migrations/010_add_runners.rb +0 -21
- data/lib/legion/data/migrations/011_add_functions.rb +0 -29
- data/lib/legion/data/migrations/012_add_tasks.rb +0 -28
- data/lib/legion/data/migrations/013_add_task_logs.rb +0 -23
- data/lib/legion/data/migrations/014_add_relationships.rb +0 -27
- data/lib/legion/data/migrations/016_change_task_args.rb +0 -7
- data/lib/legion/data/migrations/017_add_payload_task.rb +0 -7
- data/lib/legion/data/migrations/018_add_migration_column.rb +0 -7
- data/lib/legion/data/migrations/019_add_debug_to_relationships.rb +0 -7
- data/lib/legion/data/migrations/020_add_delay_debug_to_tasks.rb +0 -8
- data/lib/legion/data/models/chain.rb +0 -11
- data/lib/legion/data/models/datacenter.rb +0 -11
- data/lib/legion/data/models/environment.rb +0 -11
- data/lib/legion/data/models/group.rb +0 -10
- data/lib/legion/data/models/relationship.rb +0 -16
- data/lib/legion/data/models/user.rb +0 -10
data/NOTICE.txt
ADDED
data/README.md
CHANGED
@@ -1,37 +1,74 @@
|
|
1
|
-
|
1
|
+
Legion::Data
|
2
|
+
=====
|
2
3
|
|
3
|
-
Legion::Data is
|
4
|
-
added as a migration with proper up/downs.
|
4
|
+
Legion::Data is a gem for the LegionIO framework to use persistent storage. Currently only MySQL is supported
|
5
5
|
|
6
|
-
|
6
|
+
Supported Ruby versions and implementations
|
7
|
+
------------------------------------------------
|
7
8
|
|
8
|
-
|
9
|
+
Legion::Json should work identically on:
|
9
10
|
|
10
|
-
|
11
|
-
gem 'legion-data'
|
12
|
-
```
|
11
|
+
* Ruby 2.5+
|
13
12
|
|
14
|
-
And then execute:
|
15
13
|
|
16
|
-
|
14
|
+
Installation and Usage
|
15
|
+
------------------------
|
17
16
|
|
18
|
-
|
17
|
+
You can verify your installation using this piece of code:
|
19
18
|
|
20
|
-
|
19
|
+
```bash
|
20
|
+
gem install legion-data
|
21
|
+
```
|
21
22
|
|
22
|
-
|
23
|
+
```ruby
|
24
|
+
require 'legion/data'
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
requirement inside your definitions with the following
|
26
|
+
Legion::Data.setup
|
27
|
+
Legion::Data.connected? # => true
|
28
|
+
Legion::Data::Model::Extension.all # Sequel::Dataset
|
28
29
|
```
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
|
31
|
+
Settings
|
32
|
+
----------
|
33
|
+
|
34
|
+
```json
|
35
|
+
{
|
36
|
+
"connected": false,
|
37
|
+
"cache": {
|
38
|
+
"connected": false,
|
39
|
+
"auto_enable": null,
|
40
|
+
"ttl": 60
|
41
|
+
},
|
42
|
+
"connection": {
|
43
|
+
"log": false,
|
44
|
+
"log_connection_info": false,
|
45
|
+
"log_warn_duration": 1,
|
46
|
+
"log_warn_duration": "debug",
|
47
|
+
"max_connections": 10,
|
48
|
+
"preconnect": false
|
49
|
+
},
|
50
|
+
"creds": {
|
51
|
+
"username": "legion",
|
52
|
+
"password": "legion",
|
53
|
+
"database": "legionio",
|
54
|
+
"host": "127.0.0.1",
|
55
|
+
"port": 3306
|
56
|
+
},
|
57
|
+
"migrations": {
|
58
|
+
"continue_on_fail": false,
|
59
|
+
"auto_migrate": true,
|
60
|
+
"ran": false,
|
61
|
+
"version": null
|
62
|
+
},
|
63
|
+
"models": {
|
64
|
+
"continue_on_load_fail": false,
|
65
|
+
"autoload": true
|
66
|
+
},
|
67
|
+
"connect_on_start": true
|
68
|
+
}
|
32
69
|
```
|
33
|
-
and the framework will take care of the rest.
|
34
70
|
|
35
|
-
|
71
|
+
Authors
|
72
|
+
----------
|
36
73
|
|
37
|
-
|
74
|
+
* [Matthew Iverson](https://github.com/Esity) - current maintainer
|
data/SECURITY.md
ADDED
data/attribution.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Add attributions here.
|
data/legion-data.gemspec
CHANGED
@@ -1,46 +1,33 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/legion/data/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = 'legion-data'
|
7
7
|
spec.version = Legion::Data::VERSION
|
8
8
|
spec.authors = ['Esity']
|
9
|
-
spec.email = [
|
10
|
-
|
11
|
-
spec.summary = 'Used by Legion to connect to the database'
|
12
|
-
spec.description = 'The Legion connect gem'
|
13
|
-
spec.homepage = 'https://bitbucket.org/legion-io/legion-data'
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
15
|
-
|
16
|
-
spec.metadata['bug_tracker_uri'] = 'https://bitbucket.org/legion-io/legion-data/issues?status=new&status=open'
|
17
|
-
spec.metadata['changelog_uri'] = 'https://bitbucket.org/legion-io/legion-data/src/CHANGELOG.md'
|
18
|
-
spec.metadata['documentation_uri'] = 'https://bitbucket.org/legion-io/legion-data'
|
19
|
-
spec.metadata['homepage_uri'] = 'https://bitbucket.org/legion-io/legion-data'
|
20
|
-
spec.metadata['source_code_uri'] = 'https://bitbucket.org/legion-io/legion-data'
|
21
|
-
spec.metadata['wiki_uri'] = 'https://bitbucket.org/legion-io/legion-data/wiki/Home'
|
9
|
+
spec.email = %w[matthewdiverson@gmail.com ruby@optum.com]
|
22
10
|
|
23
|
-
spec.
|
24
|
-
|
25
|
-
|
26
|
-
spec.
|
27
|
-
spec.
|
11
|
+
spec.summary = 'Manages the connects to the backend database'
|
12
|
+
spec.description = 'A LegionIO gem to connect to a persistent data store'
|
13
|
+
spec.homepage = 'https://github.com/Optum/legion-data'
|
14
|
+
spec.license = 'Apache-2.0'
|
15
|
+
spec.required_ruby_version = '>= 2.5'
|
28
16
|
spec.require_paths = ['lib']
|
29
|
-
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
spec.
|
33
|
-
|
34
|
-
|
35
|
-
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.test_files = spec.files.select { |p| p =~ %r{^test/.*_test.rb} }
|
19
|
+
spec.extra_rdoc_files = %w[README.md LICENSE CHANGELOG.md]
|
20
|
+
spec.metadata = {
|
21
|
+
'bug_tracker_uri' => 'https://github.com/Optum/legion-data/issues',
|
22
|
+
'changelog_uri' => 'https://github.com/Optum/legion-data/src/main/CHANGELOG.md',
|
23
|
+
'documentation_uri' => 'https://github.com/Optum/legion-data',
|
24
|
+
'homepage_uri' => 'https://github.com/Optum/LegionIO',
|
25
|
+
'source_code_uri' => 'https://github.com/Optum/legion-data',
|
26
|
+
'wiki_uri' => 'https://github.com/Optum/legion-data/wiki'
|
27
|
+
}
|
36
28
|
|
37
29
|
spec.add_dependency 'legion-logging'
|
38
30
|
spec.add_dependency 'legion-settings'
|
39
|
-
|
40
|
-
if RUBY_ENGINE == 'jruby'
|
41
|
-
spec.add_dependency 'jdbc-mysql'
|
42
|
-
else
|
43
|
-
spec.add_dependency 'mysql2'
|
44
|
-
end
|
31
|
+
spec.add_dependency 'mysql2'
|
45
32
|
spec.add_dependency 'sequel'
|
46
33
|
end
|
data/lib/legion/data.rb
CHANGED
@@ -39,18 +39,17 @@ module Legion
|
|
39
39
|
|
40
40
|
return unless defined?(::Legion::Cache)
|
41
41
|
|
42
|
-
Legion::Data::Model::Relationship.plugin :caching, Legion::Cache, ttl: 10
|
43
|
-
Legion::Data::Model::Runner.plugin :caching, Legion::Cache, ttl: 60
|
44
|
-
Legion::Data::Model::Chain.plugin :caching, Legion::Cache, ttl: 60
|
45
|
-
Legion::Data::Model::
|
46
|
-
Legion::Data::Model::
|
47
|
-
Legion::Data::Model::
|
48
|
-
Legion::Data::Model::
|
49
|
-
Legion::Data::Model::
|
50
|
-
Legion::Data::Model::
|
51
|
-
Legion::Data::Model::
|
52
|
-
Legion::
|
53
|
-
Legion::Logging.info 'Legion::Data connected to Legion::Cache'
|
42
|
+
# Legion::Data::Model::Relationship.plugin :caching, Legion::Cache, ttl: 10
|
43
|
+
# Legion::Data::Model::Runner.plugin :caching, Legion::Cache, ttl: 60
|
44
|
+
# Legion::Data::Model::Chain.plugin :caching, Legion::Cache, ttl: 60
|
45
|
+
# Legion::Data::Model::Function.plugin :caching, Legion::Cache, ttl: 120
|
46
|
+
# Legion::Data::Model::Extension.plugin :caching, Legion::Cache, ttl: 120
|
47
|
+
# Legion::Data::Model::Node.plugin :caching, Legion::Cache, ttl: 10
|
48
|
+
# Legion::Data::Model::TaskLog.plugin :caching, Legion::Cache, ttl: 12
|
49
|
+
# Legion::Data::Model::Task.plugin :caching, Legion::Cache, ttl: 10
|
50
|
+
# Legion::Data::Model::User.plugin :caching, Legion::Cache, ttl: 120
|
51
|
+
# Legion::Data::Model::Group.plugin :caching, Legion::Cache, ttl: 120
|
52
|
+
# Legion::Logging.info 'Legion::Data connected to Legion::Cache'
|
54
53
|
end
|
55
54
|
|
56
55
|
def shutdown
|
@@ -33,11 +33,11 @@ module Legion
|
|
33
33
|
final_creds.merge! Legion::Data::Settings.creds
|
34
34
|
final_creds.merge! Legion::Settings[:data][:creds] if Legion::Settings[:data][:creds].is_a? Hash
|
35
35
|
|
36
|
-
if Legion::Settings[:data][:connection][:max_connections].is_a? Integer
|
37
|
-
|
38
|
-
end
|
36
|
+
# if Legion::Settings[:data][:connection][:max_connections].is_a? Integer
|
37
|
+
# final_creds[:max_connections] = Legion::Settings[:data][:connection][:max_connections]
|
38
|
+
# end
|
39
39
|
|
40
|
-
final_creds[:preconnect] = :concurrently if Legion::Settings[:data][:connection][:preconnect]
|
40
|
+
# final_creds[:preconnect] = :concurrently if Legion::Settings[:data][:connection][:preconnect]
|
41
41
|
|
42
42
|
return final_creds if Legion::Settings[:vault].nil?
|
43
43
|
|
@@ -52,11 +52,11 @@ module Legion
|
|
52
52
|
|
53
53
|
def default_creds
|
54
54
|
{
|
55
|
-
host:
|
56
|
-
port:
|
57
|
-
username:
|
58
|
-
password:
|
59
|
-
database:
|
55
|
+
host: '127.0.0.1',
|
56
|
+
port: 3306,
|
57
|
+
username: 'legion',
|
58
|
+
password: 'legion',
|
59
|
+
database: 'legion',
|
60
60
|
max_connections: 4
|
61
61
|
}
|
62
62
|
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
run "CREATE TABLE `nodes` (
|
4
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
+
`name` varchar(128) NOT NULL DEFAULT '',
|
6
|
+
`status` varchar(255) NOT NULL DEFAULT 'unknown',
|
7
|
+
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
8
|
+
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
9
|
+
`updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
10
|
+
PRIMARY KEY (`id`),
|
11
|
+
UNIQUE KEY `name` (`name`),
|
12
|
+
KEY `active` (`active`),
|
13
|
+
KEY `status` (`status`)
|
14
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
15
|
+
end
|
16
|
+
|
17
|
+
down do
|
18
|
+
drop_table :nodes
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
run "CREATE TABLE `settings` (
|
4
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
+
`key` varchar(128) NOT NULL,
|
6
|
+
`value` varchar(256) NOT NULL,
|
7
|
+
`encrypted` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
8
|
+
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
9
|
+
`updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
10
|
+
PRIMARY KEY (`id`),
|
11
|
+
UNIQUE KEY `key` (`key`)
|
12
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
13
|
+
end
|
14
|
+
|
15
|
+
down do
|
16
|
+
drop_table :settings
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
run "CREATE TABLE `extensions` (
|
4
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
+
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
6
|
+
`name` varchar(128) NOT NULL,
|
7
|
+
`namespace` varchar(128) NOT NULL DEFAULT '',
|
8
|
+
`exchange` varchar(255) DEFAULT NULL,
|
9
|
+
`uri` varchar(256) DEFAULT NULL,
|
10
|
+
`schema_version` int(11) unsigned NOT NULL DEFAULT 0,
|
11
|
+
`updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
12
|
+
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
13
|
+
PRIMARY KEY (`id`),
|
14
|
+
UNIQUE KEY `name_namespace` (`name`,`namespace`),
|
15
|
+
KEY `active` (`active`),
|
16
|
+
KEY `name` (`name`),
|
17
|
+
KEY `namespace` (`namespace`),
|
18
|
+
key `schema_version` (`schema_version`)
|
19
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
20
|
+
end
|
21
|
+
|
22
|
+
down do
|
23
|
+
drop_table :extensions
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
run "CREATE TABLE `runners` (
|
4
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
+
`extension_id` int(11) unsigned NOT NULL,
|
6
|
+
`name` varchar(256) NOT NULL DEFAULT '',
|
7
|
+
`namespace` varchar(256) NOT NULL DEFAULT '',
|
8
|
+
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
9
|
+
`queue` varchar(256) DEFAULT NULL,
|
10
|
+
`uri` varchar(256) DEFAULT NULL,
|
11
|
+
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
12
|
+
`updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
13
|
+
PRIMARY KEY (`id`),
|
14
|
+
CONSTRAINT `runner_extension_id` FOREIGN KEY (`extension_id`) REFERENCES `extensions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
15
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
16
|
+
end
|
17
|
+
|
18
|
+
down do
|
19
|
+
drop_table :runners
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
run "CREATE TABLE `functions` (
|
4
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
+
`name` varchar(128) NOT NULL,
|
6
|
+
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
7
|
+
`runner_id` int(11) unsigned NOT NULL,
|
8
|
+
`args` text,
|
9
|
+
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
10
|
+
`updated` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
11
|
+
PRIMARY KEY (`id`),
|
12
|
+
UNIQUE KEY `runner_id` (`runner_id`,`name`),
|
13
|
+
KEY `active` (`active`),
|
14
|
+
KEY `namespace` (`runner_id`),
|
15
|
+
KEY `name` (`name`),
|
16
|
+
CONSTRAINT `function_runner_id` FOREIGN KEY (`runner_id`) REFERENCES `runners` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
17
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
18
|
+
end
|
19
|
+
|
20
|
+
down do
|
21
|
+
drop_table :functions
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
run "CREATE TABLE `tasks` (
|
4
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
5
|
+
`relationship_id` int(11) unsigned DEFAULT NULL,
|
6
|
+
`function_id` int(11) unsigned DEFAULT NULL,
|
7
|
+
`status` varchar(255) NOT NULL,
|
8
|
+
`parent_id` int(11) unsigned DEFAULT NULL,
|
9
|
+
`master_id` int(11) unsigned DEFAULT NULL,
|
10
|
+
`function_args` text,
|
11
|
+
`results` text,
|
12
|
+
`payload` text,
|
13
|
+
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
14
|
+
`updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
15
|
+
PRIMARY KEY (`id`),
|
16
|
+
KEY `status` (`status`),
|
17
|
+
KEY `parent_id` (`parent_id`),
|
18
|
+
KEY `master_id` (`master_id`),
|
19
|
+
KEY `relationship_id` (`relationship_id`),
|
20
|
+
KEY `function_id` (`function_id`),
|
21
|
+
CONSTRAINT `parent_id` FOREIGN KEY (`parent_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
22
|
+
CONSTRAINT `master_id` FOREIGN KEY (`master_id`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
23
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
24
|
+
end
|
25
|
+
|
26
|
+
down do
|
27
|
+
drop_table :tasks
|
28
|
+
end
|
29
|
+
end
|
data/lib/legion/data/model.rb
CHANGED
@@ -5,7 +5,7 @@ module Legion
|
|
5
5
|
attr_reader :loaded_models
|
6
6
|
|
7
7
|
def models
|
8
|
-
%w[
|
8
|
+
%w[extension function task runner node setting]
|
9
9
|
end
|
10
10
|
|
11
11
|
def load
|
@@ -16,7 +16,7 @@ module Legion
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def require_sequel_models(files = models)
|
19
|
-
Dir["#{File.dirname(__FILE__)}models/*.rb"].each { |file| puts file }
|
19
|
+
# Dir["#{File.dirname(__FILE__)}models/*.rb"].each { |file| puts file }
|
20
20
|
files.each { |file| load_sequel_model(file) }
|
21
21
|
end
|
22
22
|
|
File without changes
|
@@ -1,14 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative 'relationship'
|
4
|
-
|
5
3
|
module Legion
|
6
4
|
module Data
|
7
5
|
module Model
|
8
6
|
class Function < Sequel::Model
|
9
7
|
many_to_one :runner
|
10
|
-
one_to_many :trigger_relationships, class: 'Legion::Data::Model::Relationship', key: :trigger_id
|
11
|
-
one_to_many :action_relationships, class: 'Legion::Data::Model::Relationship', key: :action_id
|
8
|
+
# one_to_many :trigger_relationships, class: 'Legion::Data::Model::Relationship', key: :trigger_id
|
9
|
+
# one_to_many :action_relationships, class: 'Legion::Data::Model::Relationship', key: :action_id
|
12
10
|
end
|
13
11
|
end
|
14
12
|
end
|