Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Jun 8, 2021
1 parent ded06f1 commit 20b52f5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create
end

AuditLog.rate_limit_log(event_type: 'comment', related: @comment, user: current_user,
comment: "limit: #{max_comments_per_day}\n\comment:\n#{@comment.attributes_print}")
comment: "limit: #{max_comments_per_day}\n\comment:\n#{@comment.attributes_print}")

render json: { status: 'failed', message: comment_limit_msg }, status: :forbidden
return
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/flags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def new
' flags. Please come back tomorrow to continue flagging.'

AuditLog.rate_limit_log(event_type: 'flag', related: Post.find(params[:post_id]), user: current_user,
comment: "limit: #{max_flags_per_day}\n\ntype:#{type}\ncomment:\n#{params[:reason].to_i}")
comment: "limit: #{max_flags_per_day}\n\ntype:#{type}\ncomment:\n#{params[:reason].to_i}")

render json: { status: 'failed', message: flag_limit_msg }, status: :forbidden
return
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/mod_warning_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create
if @warning.save
if is_suspension
@user.community_user.update(is_suspended: is_suspension, suspension_end: suspension_end,
suspension_public_comment: params[:mod_warning][:suspension_public_notice])
suspension_public_comment: params[:mod_warning][:suspension_public_notice])
end

redirect_to user_path(@user)
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ def delete
last_activity: DateTime.now, last_activity_by: current_user)
PostHistory.post_deleted(@post, current_user)
if @post.children.where(deleted: false).any?
@post.children.where(deleted: false).update_all(deleted: true, deleted_at: DateTime.now, deleted_by_id: current_user.id,
last_activity: DateTime.now, last_activity_by_id: current_user.id)
@post.children.where(deleted: false).update_all(deleted: true, deleted_at: DateTime.now,
deleted_by_id: current_user.id, last_activity: DateTime.now,
last_activity_by_id: current_user.id)
histories = @post.children.map do |c|
{ post_history_type: PostHistoryType.find_by(name: 'post_deleted'), user: current_user, post: c,
community: RequestContext.community }
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/suggested_edit_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def reject
now = DateTime.now

if @edit.update(active: false, accepted: false, rejected_comment: params[:rejection_comment], decided_at: now,
decided_by: current_user, updated_at: now)
decided_by: current_user, updated_at: now)
flash[:success] = 'Edit rejected successfully.'
AbilityQueue.add(@edit.user, "Suggested Edit Rejected ##{@edit.id}")
render json: { status: 'success', redirect_url: helpers.generic_share_link(@post) }
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def mod_privilege_action
comment: "#{ability.internal_id} ability removed")

AuditLog.user_history(event_type: 'deleted_ability', related: nil, user: @user,
comment: ability.internal_id)
comment: ability.internal_id)
else
return not_found
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/votes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def create
' are exempt.'

AuditLog.rate_limit_log(event_type: 'vote', related: post, user: current_user,
comment: "limit: #{max_votes_per_day}\n\nvote:\n#{params[:vote_type].to_i}")
comment: "limit: #{max_votes_per_day}\n\nvote:\n#{params[:vote_type].to_i}")

render json: { status: 'failed', message: vote_limit_msg }, status: :forbidden
return
Expand Down

0 comments on commit 20b52f5

Please sign in to comment.