新增:项目标记关联组织接口

This commit is contained in:
2024-01-04 14:25:40 +08:00
parent 7d1b4da72c
commit 5fafd8195c
4 changed files with 78 additions and 1 deletions

View File

@@ -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?