`

[gem] acts_as_list

阅读更多
注意事项:
1. 当在 STI 中,用 type 字段来做 scope 时,如果使用 Symbol,就会报错
acts_as_list scope: :type

原因在:https://www.ruby-forum.com/topic/91504
解决办法:改成数组
acts_as_list scope: [:type]

注意:不能改成 acts_as_list scope: 'type',因为 String 类型的参数会被直接拿来做 condition 用
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics