*前提*
schema.rb
t.integer "sex"
t.integer "age"
通常のenum(文字列のみ)の書き方は以下の通り。
user.rb
enum sex: { 未選択: 0, 男性: 1, 女性: 2 }
enumで数字を含めるには以下のように
user.rb
enum age: { 未選択: 0, "10代": 1, "20代": 2, "30代": 3, "40代": 4, "50代": 5, "60代": 6, "70代": 7, "80代": 8, "90代": 9 }
キーをダブルクオーテーション("")で囲えば良い。
むしろ本来こんなふうに書くべきなのかもしれない。