Skip to content

Commit

Permalink
don't always query first user for rivals
Browse files Browse the repository at this point in the history
  • Loading branch information
BatedUrGonnaDie committed Jun 19, 2018
1 parent ae4815f commit c908893
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def to_s
end

def rivals
User.joins('INNER JOIN rivalries ON rivalries.to_user_id = users.id AND rivalries.from_user_id = 1')
User.joins('INNER JOIN rivalries ON rivalries.to_user_id = users.id AND rivalries.from_user_id = ' + self.id)
.select('users.*, rivalries.category_id')
end

Expand Down

0 comments on commit c908893

Please sign in to comment.