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
精彩评论