From b188c5cae0a0c36aa9dee8136e466bf6b6c975d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 24 May 2024 17:23:57 +0200 Subject: [PATCH] Simplify method to get existing locales We can get the same results using `pluck`. --- app/models/i18n_content_translation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/i18n_content_translation.rb b/app/models/i18n_content_translation.rb index e15d3e54b..165dd8a60 100644 --- a/app/models/i18n_content_translation.rb +++ b/app/models/i18n_content_translation.rb @@ -1,5 +1,5 @@ class I18nContentTranslation < ApplicationRecord def self.existing_locales - self.select(:locale).distinct.map { |l| l.locale.to_sym }.to_a + distinct.pluck(:locale).map(&:to_sym) end end