Rails 表 1 返回字段 id_a,表 2 需要 id not in [id_a] 判断,但是 rails 提示 id 无效

lin_style · 2012年05月21日 · 2275 次阅读

这样写,提示 User.where 的 id 找不到 debug1 = Follow.select('follow_id').where(["id=?", @user.id])

@fans_records = User.where("id not in(?)",debug1)

这样通过。但是我想把 User.id 放在 Follow.follow_id 里比较。 debug1 = Follow.select('id,follow_id').where(["id=?", @user.id])

@fans_records = User.where("id not in(?)",debug1)

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号