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

lin_style · May 21, 2012 · 2276 hits

这样写,提示 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)

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.