summaryrefslogtreecommitdiff
path: root/app/models/projects
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-24 15:10:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-24 15:10:36 +0000
commit234dc40a12a1cdaef0cdb825ca4acc3f271c6394 (patch)
treefb9875dca8b558acafa54c36a591b4d2ed10fc49 /app/models/projects
parentc7864d3d50b4002c621c7cba2e1ebfb5d23ac7ed (diff)
downloadgitlab-ce-234dc40a12a1cdaef0cdb825ca4acc3f271c6394.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/projects')
-rw-r--r--app/models/projects/project_topic.rb8
-rw-r--r--app/models/projects/topic.rb10
2 files changed, 18 insertions, 0 deletions
diff --git a/app/models/projects/project_topic.rb b/app/models/projects/project_topic.rb
new file mode 100644
index 00000000000..d4b456ef482
--- /dev/null
+++ b/app/models/projects/project_topic.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+module Projects
+ class ProjectTopic < ApplicationRecord
+ belongs_to :project
+ belongs_to :topic
+ end
+end
diff --git a/app/models/projects/topic.rb b/app/models/projects/topic.rb
new file mode 100644
index 00000000000..a17aa550edb
--- /dev/null
+++ b/app/models/projects/topic.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module Projects
+ class Topic < ApplicationRecord
+ validates :name, presence: true, uniqueness: true, length: { maximum: 255 }
+
+ has_many :project_topics, class_name: 'Projects::ProjectTopic'
+ has_many :projects, through: :project_topics
+ end
+end