From 8790657c4c2520a19b8a06a9992fd9b9b100df05 Mon Sep 17 00:00:00 2001 From: ot0m1 Date: Sat, 5 Feb 2022 21:58:25 +0900 Subject: [PATCH 01/25] first commit From f859a3f9d0a11872f911d67632984c1243c25950 Mon Sep 17 00:00:00 2001 From: ot0m1 Date: Thu, 10 Feb 2022 23:00:24 +0900 Subject: [PATCH 02/25] =?UTF-8?q?=E7=9B=B8=E8=AB=87=E9=83=A8=E5=B1=8B?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/search_helper.rb | 8 ++++++++ app/javascript/searchable.vue | 12 ++++++++++++ app/views/api/searchables/_searchable.json.jbuilder | 9 +++++++++ 3 files changed, 29 insertions(+) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index e2395913a10..ed9178499a4 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -39,4 +39,12 @@ def filtered_message(searchable) def comment_or_answer?(searchable) searchable.is_a?(Comment) || searchable.is_a?(Answer) end + + def has_talk?(searchable) + searchable.instance_of?(User) && Talk.find_by(user_id: searchable.id) ? true : false + end + + def talk_id(searchable) + Talk.find_by(user_id: searchable.id).id + end end diff --git a/app/javascript/searchable.vue b/app/javascript/searchable.vue index 4cf7e48e23d..0989542403c 100644 --- a/app/javascript/searchable.vue +++ b/app/javascript/searchable.vue @@ -36,6 +36,8 @@ | {{ searchable.document_author_login_name }} |  {{ searchable.model_name_with_i18n }} | ) + a(v-if='canDisplayTalk', :href='talkUrl') + | 相談部屋