阅读背景:

Ruby - 基于布尔变量实例化数组值

来源:互联网 

My user model has seven boolean columns (:mon, :tue... :sat, :sun) for each day of the week. In one of the user methods I need to create an array of strings like ["mon", "tue"... "sat", "sun"] for use in time parsing. As you can guess, these array values come from the database columns, and should only be in the array if that column is true.My user model has seven boolean columns (:mon,




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: