Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing the query, oops

  • Loading branch information...
commit e79ce6b2b3afb59db56d2c427e2e37172f044139 1 parent b59e53f
@Breefield Breefield authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/controllers/users_controller.rb
View
2  app/controllers/users_controller.rb
@@ -6,7 +6,7 @@ def message
# Then we write this query to get all the messages sent between user A and B,
# or B and A depending on who sent the message
- @messages = Message.where("(sender_id = ? AND receiver_id = ?) OR (sender_id = ? AND receiver_id = ?)", current_user.id, @user.id, current_user.id, @user.id)
+ @messages = Message.where("(sender_id = ? AND receiver_id = ?) OR (sender_id = ? AND receiver_id = ?)", current_user.id, @user.id, @user.id, current_user.id)
@message = Message.new
end
Please sign in to comment.
Something went wrong with that request. Please try again.