5
3
mirror of https://github.com/tildeverse/lobsters synced 2024-06-14 21:16:37 +00:00
This commit is contained in:
Peter Bhat Harkins 2018-04-16 15:11:55 -05:00
parent a0aca1ea15
commit bf6bc8c2c5

View File

@ -522,7 +522,7 @@ class User < ApplicationRecord
def votes_for_others
self.votes.left_outer_joins(:story, :comment)
.where("(votes.comment_id is null or comments.user_id <> votes.user_id) AND " <<
.where("(votes.comment_id is not null and comments.user_id <> votes.user_id) OR " <<
"(votes.comment_id is null and stories.user_id <> votes.user_id)")
.order("id DESC")
end