From 46381e90d17081c8a39a6c5000fdbfb1d5dba687 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 18 Sep 2024 11:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=A0=87=E7=AD=BE=E6=9C=AA=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/concerns/matchable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/matchable.rb b/app/models/concerns/matchable.rb index 27e5a0dda..3ada903af 100644 --- a/app/models/concerns/matchable.rb +++ b/app/models/concerns/matchable.rb @@ -6,8 +6,8 @@ module Matchable scope :with_project_language, ->(language_id) { where(project_language_id: language_id) unless language_id.blank? } scope :with_project_type, ->(project_type) { where(project_type: project_type) if Project.project_types.include?(project_type) } scope :by_name_or_identifier, ->(search) { where("name like :search or identifier LIKE :search", :search => "%#{search.split(" ").join('|')}%") unless search.blank? } - scope :with_project_topic, ->(topic_id) {joins(:project_topics).where(project_topics: {id: topic_id}) unless topic_id.blank?} - scope :with_project_topic_name, ->(topic_name) {joins(:project_topics).where(project_topics: {name: topic_name}) unless topic_name.blank?} + scope :with_project_topic, ->(topic_id) {left_outer_joins(:project_topics).where(project_topics: {id: topic_id}) unless topic_id.blank?} + scope :with_project_topic_name, ->(topic_name) {left_outer_joins(:project_topics).where(project_topics: {name: topic_name}) unless topic_name.blank?} end end