Simplify method to get existing locales
We can get the same results using `pluck`.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user