ITeye博客

[gem] acts_as_list

tiroc · 2013-07-09 15:09 · Ruby on Rails · 编程语言 · Markdown

注意事项:

  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 用

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。