Simplify method to get existing locales

We can get the same results using `pluck`.
This commit is contained in:
Javi Martín
2024-05-24 17:23:57 +02:00
parent b451a251fc
commit b188c5cae0

View File

@@ -1,5 +1,5 @@
class I18nContentTranslation < ApplicationRecord class I18nContentTranslation < ApplicationRecord
def self.existing_locales def self.existing_locales
self.select(:locale).distinct.map { |l| l.locale.to_sym }.to_a distinct.pluck(:locale).map(&:to_sym)
end end
end end