fix cla
This commit is contained in:
parent
b938025e5b
commit
6b772ea889
|
@ -47,7 +47,7 @@ class Organizations::ClasController < Organizations::BaseController
|
||||||
|
|
||||||
private
|
private
|
||||||
def cla_params
|
def cla_params
|
||||||
params.permit(:name, :key, :content, :organization_id, :pr_need)
|
params.permit(:name, :key, :content, :pr_need)
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_organization
|
def load_organization
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Organizations::CreateClaForm < BaseForm
|
class Organizations::CreateClaForm < BaseForm
|
||||||
KEY_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
|
KEY_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
|
||||||
attr_accessor :name, :key, :content, :organization_id, :pr_need
|
attr_accessor :name, :key, :content, :pr_need
|
||||||
validates :name, :organization_id , :key, presence: true
|
validates :name , :key, presence: true
|
||||||
validates :key, format: { with: KEY_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
|
validates :key, format: { with: KEY_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
|
||||||
end
|
end
|
Loading…
Reference in New Issue