Skip to content
Snippets Groups Projects
Commit a13f3019 authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

Don't load user

parent f5047618
Branches
Tags
No related merge requests found
......@@ -13,7 +13,7 @@ class VotesController < ApplicationController
recent_votes = Vote.where(created_at: 24.hours.ago..Time.now, user: current_user).count
max_votes_per_day = SiteSetting['FreeVotes'] + (@current_user.reputation - SiteSetting['NewUserInitialRep'])
unless post&.parent&.user&.id == current_user.id
unless post.parent&.user_id == current_user.id
if recent_votes >= max_votes_per_day
vote_limit_msg = 'You have used your daily vote limit of ' + recent_votes.to_s + 'votes. Gain more reputation' \
' or come back tomorrow to continue voting.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment