mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
增加流水线节点名称,和标识区分
This commit is contained in:
@@ -36,6 +36,11 @@ class Action::Node < ApplicationRecord
|
||||
|
||||
attr_accessor :cust_name, :run_values, :input_values
|
||||
|
||||
validates :name, presence: { message: "不能为空" }
|
||||
validates :full_name, length: { maximum: 200, too_long: "不能超过200个字符" }
|
||||
validates :label, length: { maximum: 200, too_long: "不能超过200个字符" }
|
||||
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
|
||||
|
||||
def content_yaml
|
||||
"foo".to_yaml
|
||||
|
||||
@@ -24,4 +24,7 @@ class Action::NodeInput < ApplicationRecord
|
||||
default_scope { order(sort_no: :asc) }
|
||||
|
||||
belongs_to :action_node, :class_name => 'Action::Node', foreign_key: "action_nodes_id"
|
||||
|
||||
validates :name, presence: { message: "不能为空" }
|
||||
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
end
|
||||
|
||||
@@ -29,6 +29,9 @@ class Action::NodeSelect < ApplicationRecord
|
||||
belongs_to :action_node, :class_name => 'Action::Node', foreign_key: "action_nodes_id"
|
||||
belongs_to :user, optional: true
|
||||
|
||||
validates :name, presence: { message: "不能为空" }
|
||||
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
|
||||
def value
|
||||
if self.val_ext.blank?
|
||||
self.val
|
||||
|
||||
@@ -15,4 +15,7 @@ class Action::NodeType < ApplicationRecord
|
||||
default_scope { order(sort_no: :asc) }
|
||||
|
||||
has_many :action_nodes, :class_name => 'Action::Node', foreign_key: "action_node_types_id"
|
||||
|
||||
validates :name, presence: { message: "不能为空" }
|
||||
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
end
|
||||
|
||||
@@ -33,5 +33,7 @@ class Action::Pipeline < ApplicationRecord
|
||||
belongs_to :user, optional: true
|
||||
belongs_to :project
|
||||
|
||||
|
||||
validates :name, presence: { message: "不能为空" }
|
||||
validates :json, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
validates :yaml, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
end
|
||||
|
||||
@@ -17,4 +17,7 @@ class Action::Template < ApplicationRecord
|
||||
self.table_name = 'action_templates'
|
||||
default_scope { order(sort_no: :asc) }
|
||||
|
||||
validates :name, presence: { message: "不能为空" }
|
||||
validates :description, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user