Skip to content

Commit 8f111a3

Browse files
committed
remove no longer needed reloads of post model to get the updated score
1 parent d2c924f commit 8f111a3

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

app/controllers/votes_controller.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def create
4141

4242
AbilityQueue.add(post.user, "Vote Change on ##{post.id}")
4343

44-
post.reload
45-
4644
modified = !destroyed.empty?
4745
state = { status: (modified ? 'modified' : 'OK'),
4846
vote_id: vote.id,
@@ -63,8 +61,6 @@ def destroy
6361
end
6462

6563
if vote.destroy
66-
post.reload
67-
6864
AbilityQueue.add(post.user, "Vote Change on ##{post.id}")
6965
render json: { status: 'OK',
7066
upvotes: post.upvote_count,

0 commit comments

Comments
 (0)