From bfee1b0ecb034a51f9d5577001df1a7269c453ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 13 May 2024 23:21:20 +0200 Subject: [PATCH] Simplify query to get possible answers We added the code indicating the table in commit 673ec075e because back then we had a `title` column in both the `poll_question_answers` table and the `poll_question_answer_translations` table. Since that's no longer the case since commit 7a7877656, we can simplify the code. --- app/models/poll/question.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index 9e043d499..d77873d6f 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -72,7 +72,7 @@ class Poll::Question < ApplicationRecord end def possible_answers - question_answers.joins(:translations).pluck("poll_question_answer_translations.title") + question_answers.joins(:translations).pluck(:title) end def answers_with_read_more?