Skip to content

Commit a2f353d

Browse files
committed
Make Rubocop happy
1 parent b19769c commit a2f353d

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

app/controllers/comments_controller.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Provides mainly web actions for using and making comments.
2+
3+
# rubocop:disable Metrics/ClassLength
24
class CommentsController < ApplicationController
35
before_action :authenticate_user!, except: [:post, :show, :thread]
46
before_action :set_comment, only: [:update, :destroy, :undelete, :show]
@@ -84,12 +86,12 @@ def create
8486
.where('link LIKE ?', "#{thread_url}%")
8587
next if existing_notification.exists?
8688

87-
unless @post.nil?
88-
title = @post.parent.nil? ? @post.title : @post.parent.title
89-
follower.user.create_notification("There are new comments in a followed thread '#{@comment_thread.title}' " \
90-
"on the post '#{title}'",
91-
helpers.comment_link(@comment))
92-
end
89+
next if @post.nil?
90+
91+
title = @post.parent.nil? ? @post.title : @post.parent.title
92+
follower.user.create_notification("There are new comments in a followed thread '#{@comment_thread.title}' " \
93+
"on the post '#{title}'",
94+
helpers.comment_link(@comment))
9395
end
9496
else
9597
flash[:danger] = @comment.errors.full_messages.join(', ')
@@ -368,3 +370,4 @@ def comment_rate_limited
368370
false
369371
end
370372
end
373+
# rubocop:enable Metrics/ClassLength

app/controllers/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def mod_contact
165165
def mod_message
166166
title = params[:title]
167167
unless title.present?
168-
title = "Private Moderator Message"
168+
title = 'Private Moderator Message'
169169
end
170170

171171
body = params[:body]

app/models/comment_thread.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CommentThread < ApplicationRecord
22
include CommunityRelated
3-
3+
44
belongs_to :post, optional: true
55
has_many :comments
66
has_many :thread_follower

0 commit comments

Comments
 (0)