diff options
Diffstat (limited to 'app/models/projects/topic.rb')
-rw-r--r-- | app/models/projects/topic.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 |