Rails 4 Active Record Enums are great, but what is the right pattern for translating with i18n?
Model:
enum stage: { starting: 1, course: 2, ending: 3 }
def self.i18n_stages(hash = {})
stages.keys.each { |key| hash[I18n.t("checkpoint_stages.#{key}")] = key }
hash
end
Locale:
checkpoint_stages:
starting: Saída
course: Percurso
ending: Chegada
And on the view (.slim):
= f.input_field :stage, collection: Checkpoint.i18n_stages, as: :radio_buttons