barsoom/traco

Minor: `Record.locale_columns` does not order by `I18n.default_locale`

PikachuEXE opened this issue · 3 comments

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]

Using I18n.with_locale(I18n.default_locale) { Building.locale_columns(:name) } atm

Ah, maybe a regression? Thanks so much, will look into soon!

Fixed in 3.1.4. Thanks again!