mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
cla init
This commit is contained in:
6
app/forms/organizations/create_cla_form.rb
Normal file
6
app/forms/organizations/create_cla_form.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Organizations::CreateClaForm < BaseForm
|
||||
KEY_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
|
||||
attr_accessor :name, :key, :content, :organization_id, :pr_need
|
||||
validates :name, :organization_id , :key, presence: true
|
||||
validates :name, format: { with: KEY_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
|
||||
end
|
||||
6
app/forms/users/user_cla_form.rb
Normal file
6
app/forms/users/user_cla_form.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Users::UserClaForm
|
||||
include ActiveModel::Model
|
||||
attr_accessor :email, :real_name, :cla_id
|
||||
validates :email, presence: true, format: { with: CustomRegexp::EMAIL }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user