forked from Trustie/forgeplus
更改:创建项目名称短变长
This commit is contained in:
parent
c33810c9bd
commit
3c6a4df233
|
|
@ -8,7 +8,7 @@ class Api::Pm::IssueLinksController < Api::Pm::BaseController
|
|||
links_2 = @links.select {|s| s.be_linkable_id == @issue.id && s.be_linkable.pm_issue_type == params[:pm_issue_type].to_i}.map{|i|i.id}
|
||||
@links = PmLink.where(id: links_1).or(PmLink.where(id: links_2))
|
||||
end
|
||||
@links = kaminari_paginate(@links.order(created_at: :desc))
|
||||
@links = kaminari_paginate(@links)
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class Projects::CreateForm < BaseForm
|
|||
validates :user_id, :name, :repository_name, presence: true
|
||||
validates :repository_name, format: { with: CustomRegexp::REPOSITORY_NAME_REGEX, multiline: true, message: "长度为2~100, 只能包含数字,字母,下划线(_),中划线(-),英文句号(.),必须以数字和字母开头,不能以下划线/中划线/英文句号开头和结尾" }
|
||||
|
||||
validates :name, length: { maximum: 50 }
|
||||
validates :name, length: { maximum: 100 }
|
||||
validates :repository_name, length: { maximum: 100 }
|
||||
validates :description, length: { maximum: 200 }
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class Projects::MigrateForm < BaseForm
|
|||
validates :user_id, :name, :repository_name, :clone_addr, presence: true
|
||||
validates :repository_name, format: { with: CustomRegexp::REPOSITORY_NAME_REGEX, multiline: true, message: "长度为2~100, 只能包含数字,字母,下划线(_),中划线(-),英文句号(.),必须以数字和字母开头,不能以下划线/中划线/英文句号开头和结尾" }
|
||||
validates :clone_addr, format: { with: CustomRegexp::URL_REGEX, multiline: true, message: "地址格式不正确" }
|
||||
validates :name, length: { maximum: 50 }
|
||||
validates :name, length: { maximum: 100 }
|
||||
validates :repository_name, length: { maximum: 100 }
|
||||
validates :description, length: { maximum: 200 }
|
||||
validate do
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class Project < ApplicationRecord
|
|||
has_one :repository, dependent: :destroy
|
||||
has_many :pull_requests, dependent: :destroy
|
||||
has_many :issue_tags, -> { order("issue_tags.created_at DESC") }, dependent: :destroy
|
||||
has_many :issues, dependent: :destroy
|
||||
has_many :issues#, dependent: :destroy
|
||||
# has_many :user_grades, dependent: :destroy
|
||||
has_many :attachments, as: :container, dependent: :destroy
|
||||
has_one :page, dependent: :destroy
|
||||
|
|
|
|||
Loading…
Reference in New Issue