From 271e1f4ac724d49b955d51634a8317f210fa3623 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 23 Oct 2024 09:27:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E:=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A0=87=E7=AD=BE=E5=85=B3=E8=81=94=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=A4=8D=E5=90=88=E5=94=AF=E4=B8=80=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/project_topic_ralate.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/project_topic_ralate.rb b/app/models/project_topic_ralate.rb index d8638699f..5c4c760a1 100644 --- a/app/models/project_topic_ralate.rb +++ b/app/models/project_topic_ralate.rb @@ -19,4 +19,8 @@ class ProjectTopicRalate < ApplicationRecord belongs_to :project_topic, counter_cache: :projects_count belongs_to :project + + validates :project_id, uniqueness: { scope: :project_topic_id } + + end