summaryrefslogtreecommitdiff
path: root/app/views/users/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/users/show.html.erb')
-rw-r--r--app/views/users/show.html.erb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index d9eb123..a48eae2 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -11,8 +11,8 @@
<%= link_to "edit profile", edit_user_path(@user), :class => "btn blue" %>
<% end %>
<% if @user.is?(current_user) %>
- <%= link_to "Private Messages (#{Message.where(user_target: current_user).count})", messages_path, :class => "btn blue" %>
- <% else %>
+ <%= link_to "Private Messages (#{Message.where("user_sender_id = ? OR user_target_id = ?", current_user.id, current_user.id).count})", messages_path, :class => "btn blue" %>
+ <% elsif current_user %>
<%= link_to "Send this user a message", new_message_path(user_target: @user.ign), :class => "btn blue" %>
<% end %>
</div>