Minor: `Record.locale_columns` does not order by `I18n.default_locale`
PikachuEXE opened this issue · 3 comments
PikachuEXE commented
From README:
.locale_columns(:title):
Returns an array like [:title_sv, :title_en] sorted with default locale first and then alphabetically.
Suitable for looping in forms
But I think it orders by I18n.locale
instead of I18n.default_locale
Example:
I18n.default_locale
=> :en
Building.locale_columns(:name)
=> [:name_en, :name_zh_tw]
I18n.locale = :'zh-TW'
=> :"zh-TW"
Building.locale_columns(:name)
=> [:name_zh_tw, :name_en]
PikachuEXE commented
Using I18n.with_locale(I18n.default_locale) { Building.locale_columns(:name) }
atm
henrik commented
Ah, maybe a regression? Thanks so much, will look into soon!
henrik commented
Fixed in 3.1.4. Thanks again!