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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user