我需要更新表中的“状态”字段,where id == question_id
. 我试过这个,但它不工作:
Questions.update_all("status = status_id.to_i",
["id = question_id"])
我有这个错误:
Mysql2::Error: Unknown column 'question_id' in 'where clause': UPDATE `questions` SET status = status_id.to_i WHERE (id = question_id)