rails_execution 0.1.12 → 0.2.1
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 +4 -4
- data/app/controllers/rails_execution/tasks_controller.rb +1 -1
- data/app/models/rails_execution/task.rb +6 -6
- data/app/models/rails_execution/task_review.rb +2 -2
- data/lib/generators/rails_execution/templates/install.rb.tt +4 -4
- data/lib/rails_execution/app_model.rb +10 -0
- data/lib/rails_execution/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d74ccfcd095e1249c15c09e7d08ded91b026eb045474c84bd7aea2565df2959
|
|
4
|
+
data.tar.gz: caa608e2e0e5c93ac6e1ec45e5e225cc0b3f06c058e190c605aac0552e2786a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1086bb4261299fe3e32bb4be67490b73dcb81c492d157d8c5b170325bbe16ab582c50543ab388a3f5af80c30b3bf57eb0916dea55c9f969dff0accf81aa9320
|
|
7
|
+
data.tar.gz: 9b87e223f8c35c53a71020d964f4c1fc6351e837e99d407e295e29907e680c8ee02414bc65f6b28fa7c060d480343eadb6be253618c52005b4230e50557ea451
|
|
@@ -222,7 +222,7 @@ module RailsExecution
|
|
|
222
222
|
helper_method :repeat_mode_options
|
|
223
223
|
|
|
224
224
|
def task_logs
|
|
225
|
-
@task_logs ||= ::RailsExecution.configuration.logging_files.call(current_task)
|
|
225
|
+
@task_logs ||= ::RailsExecution.configuration.logging_files.call(current_task) || []
|
|
226
226
|
end
|
|
227
227
|
helper_method :task_logs
|
|
228
228
|
|
|
@@ -16,7 +16,7 @@ class RailsExecution::Task < RailsExecution::AppModel
|
|
|
16
16
|
|
|
17
17
|
before_validation :auto_assign_labels
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
compat_enum :status, {
|
|
20
20
|
created: 'created',
|
|
21
21
|
reviewing: 'reviewing',
|
|
22
22
|
approved: 'approved',
|
|
@@ -25,14 +25,14 @@ class RailsExecution::Task < RailsExecution::AppModel
|
|
|
25
25
|
failed: 'failed',
|
|
26
26
|
rejected: 'rejected',
|
|
27
27
|
closed: 'closed',
|
|
28
|
-
},
|
|
28
|
+
}, prefix: :is
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
compat_enum :syntax_status, {
|
|
31
31
|
bad: 'bad',
|
|
32
32
|
good: 'good',
|
|
33
|
-
},
|
|
33
|
+
}, prefix: true
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
compat_enum :repeat_mode, {
|
|
36
36
|
none: 'Does not repeat',
|
|
37
37
|
hourly: 'Hourly',
|
|
38
38
|
daily: 'Daily',
|
|
@@ -40,7 +40,7 @@ class RailsExecution::Task < RailsExecution::AppModel
|
|
|
40
40
|
monthly: 'Monthly',
|
|
41
41
|
annually: 'Anually',
|
|
42
42
|
weekdays: 'Every weekday (Monday to Friday)',
|
|
43
|
-
},
|
|
43
|
+
}, prefix: :repeat
|
|
44
44
|
|
|
45
45
|
scope :processing, -> { where(status: PROCESSING_STATUSES) }
|
|
46
46
|
|
|
@@ -5,11 +5,11 @@ class RailsExecution::TaskReview < RailsExecution::AppModel
|
|
|
5
5
|
validates :task, presence: true
|
|
6
6
|
validates :status, presence: true
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
compat_enum :status, {
|
|
9
9
|
reviewing: 'reviewing',
|
|
10
10
|
approved: 'approved',
|
|
11
11
|
rejected: 'rejected',
|
|
12
|
-
},
|
|
12
|
+
}, prefix: :is
|
|
13
13
|
|
|
14
14
|
scope :checked, -> { where(status: [:approved, :rejected]) }
|
|
15
15
|
|
|
@@ -14,7 +14,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
14
14
|
t.column :jid, :string
|
|
15
15
|
end
|
|
16
16
|
add_index :rails_execution_tasks, :status
|
|
17
|
-
add_index :rails_execution_tasks, %i[owner_id owner_type], name: :
|
|
17
|
+
add_index :rails_execution_tasks, %i[owner_id owner_type], name: :re_tasks_owner_index
|
|
18
18
|
|
|
19
19
|
create_table :rails_execution_labels do |t|
|
|
20
20
|
t.timestamps
|
|
@@ -31,7 +31,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
31
31
|
t.column :owner_type, :string
|
|
32
32
|
end
|
|
33
33
|
add_index :rails_execution_comments, :task_id
|
|
34
|
-
add_index :rails_execution_comments, %i[owner_id owner_type], name: :
|
|
34
|
+
add_index :rails_execution_comments, %i[owner_id owner_type], name: :re_comments_owner_index
|
|
35
35
|
|
|
36
36
|
create_table :rails_execution_activities, force: true do |t|
|
|
37
37
|
t.timestamps null: false
|
|
@@ -41,7 +41,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
41
41
|
t.column :owner_type, :string
|
|
42
42
|
end
|
|
43
43
|
add_index :rails_execution_activities, :task_id
|
|
44
|
-
add_index :rails_execution_activities, %i[owner_id owner_type], name: :
|
|
44
|
+
add_index :rails_execution_activities, %i[owner_id owner_type], name: :re_activities_owner_index
|
|
45
45
|
|
|
46
46
|
create_table :rails_execution_task_reviews, force: true do |t|
|
|
47
47
|
t.timestamps null: false
|
|
@@ -51,7 +51,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
51
51
|
t.column :owner_type, :string
|
|
52
52
|
end
|
|
53
53
|
add_index :rails_execution_task_reviews, :task_id
|
|
54
|
-
add_index :rails_execution_task_reviews, %i[owner_id owner_type], name: :
|
|
54
|
+
add_index :rails_execution_task_reviews, %i[owner_id owner_type], name: :re_reviews_owner_index
|
|
55
55
|
|
|
56
56
|
create_table :rails_execution_task_labels, force: true do |t|
|
|
57
57
|
t.timestamps null: false
|
|
@@ -11,4 +11,14 @@ class RailsExecution::AppModel < model_klass
|
|
|
11
11
|
scope :descending, -> { order(id: :desc) }
|
|
12
12
|
scope :ascending, -> { order(id: :asc) }
|
|
13
13
|
|
|
14
|
+
# Supports both old (< Rails 7.0) and new (>= Rails 7.0) `enum` syntax.
|
|
15
|
+
def self.compat_enum(column, values, **options)
|
|
16
|
+
if ActiveRecord::VERSION::MAJOR >= 7
|
|
17
|
+
enum column, values, **options
|
|
18
|
+
else
|
|
19
|
+
legacy_options = options.transform_keys { |key| :"_#{key}" }
|
|
20
|
+
enum({ column => values }.merge(legacy_options))
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
14
24
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_execution
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Khoa Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: haml
|