diff --git a/app/models/forum_post_vote.rb b/app/models/forum_post_vote.rb index 88ee0f0a0..4a987e2bf 100644 --- a/app/models/forum_post_vote.rb +++ b/app/models/forum_post_vote.rb @@ -6,7 +6,7 @@ class ForumPostVote < ApplicationRecord scope :up, -> {where(score: 1)} scope :down, -> {where(score: -1)} scope :by, ->(user_id) {where(creator_id: user_id)} - scope :excluding, ->(user_id) {where("creator_id <> ?", user_id)} + scope :excluding_user, ->(user_id) {where("creator_id <> ?", user_id)} def up? score == 1 diff --git a/app/views/forum_post_votes/_list.html.erb b/app/views/forum_post_votes/_list.html.erb index 1da894209..77db71503 100644 --- a/app/views/forum_post_votes/_list.html.erb +++ b/app/views/forum_post_votes/_list.html.erb @@ -7,7 +7,7 @@ <%= render "forum_post_votes/vote", vote: vote, forum_post: forum_post %> <% end %> -<% votes.excluding(CurrentUser.user.id).each do |vote| %> +<% votes.excluding_user(CurrentUser.user.id).each do |vote| %> <%= render "forum_post_votes/vote", vote: vote, forum_post: forum_post %> <% end %>