gitlink-forgeplus/app/models/action/template.rb

24 lines
665 B
Ruby

# == Schema Information
#
# Table name: action_templates
#
# id :integer not null, primary key
# name :string(255)
# description :string(255)
# img :string(255)
# sort_no :integer default("0")
# json :text(65535)
# yaml :text(65535)
# created_at :datetime not null
# updated_at :datetime not null
#
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