mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
新增:项目标记关联组织接口
This commit is contained in:
@@ -15,9 +15,11 @@
|
||||
# gitea_url :string(255)
|
||||
# pull_requests_count :integer default("0")
|
||||
# pm_project_id :integer
|
||||
# organization_id :integer
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_issue_tags_on_organization_id (organization_id)
|
||||
# index_issue_tags_on_user_id_and_name_and_project_id (user_id,name,project_id)
|
||||
#
|
||||
|
||||
@@ -29,6 +31,9 @@ class IssueTag < ApplicationRecord
|
||||
has_many :pull_request_issues, -> {where(issue_classify: "pull_request")}, source: :issue, through: :issue_tags_relates
|
||||
belongs_to :project, optional: true, counter_cache: true
|
||||
belongs_to :user, optional: true
|
||||
belongs_to :organization, optional: true
|
||||
|
||||
scope :pm_able, -> {where(project_id: 0)}
|
||||
|
||||
validates :name, uniqueness: {scope: :project_id, message: "已存在" }, if: :pm_project?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user