• 如何让 scope 可以携带参数 at 2015年01月14日

    scope :state_in, ->(states) { where('xxxs.state in (?)', states) if states } 这样不就得了么。。。我不知道为什么还要 lambda 查询 xxxs 的状态。参数就是 states!