User.where('user_id not in (?)', CancelledUser.all.collect(&:id).join(', '))
当没有取消的用户时,上面的查询给了我以下错误。
ActiveRecord::StatementInvalid: TinyTds::Error: 从字符串转换为唯一标识符时转换失败。: EXEC sp_executesql N'SELECT [users].* FROM [userss] WHERE (user_id not in (N''''))'
我该如何解决?