Skip to content

Commit e810ce9

Browse files
committed
Use none? instead of count == 0 thanks to rubocop
1 parent cc78ab6 commit e810ce9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/controllers/comments_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def post
276276

277277
def post_follow
278278
@post = Post.find(params[:post_id])
279-
if ThreadFollower.where(post: @post, user: current_user).count == 0
279+
if ThreadFollower.where(post: @post, user: current_user).none?
280280
ThreadFollower.create(post: @post, user: current_user)
281281
end
282282
redirect_to post_path(@post)

0 commit comments

Comments
 (0)