开发者

Mysql2::Error: Operand should contain 1 column(s)

This line in my controller:

开发者_StackOverflow中文版@feedback = Feedback.where("reviewer_id = ?, reviewee_id = ?, strength_id = ?", current_user.id, @report_for.id, @context ).first

produces this error when I attempt to display @feedback.something:

Mysql2::Error: Operand should contain 1 column(s): SELECT  `feedbacks`.* FROM `feedbacks` WHERE (reviewer_id = 1, reviewee_id = 10, strength_id = 0) LIMIT 1


I think your SQL is wrong, try this

@feedback = Feedback.where("reviewer_id = ? and reviewee_id = ? and strength_id = ?", current_user.id, @report_for.id, @context ).first
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜