我在我的Rails應用程序中有一個名爲Player
的表,並且在表格中有七個布爾屬性。如何返回此紅寶石陣列
monday: true, tuesday: false, wednesday: true, thursday: false, friday: false, saturday: true, sunday: false
什麼是返回與所有與ActiveRecord
真天的數組的最佳方式?我想返回:
["monday", "wednesday", "saturday"]
有效的方法來做到這一點的任何想法?我正在畫空白? Player.first.map
?
請注意。告訴玩家表格/其中'monday:true ...'數據有更多一點的表格的結構.. –