Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update batch_controller.rb #11521

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/controllers/batch_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def batch_spam
user_spamed << user.id
user.ban
end
flash[:notice] = node_spamed.to_s + ' nodes spammed and ' + user_spamed.length.to_s + ' users banned.'
flash[:notice] = "#{node_spamed} nodes spammed and #{user_spamed.length} users banned."
redirect_to '/spam2'
else
flash[:error] = 'Only admins and moderators can mark a batch spam.'
Expand All @@ -33,7 +33,7 @@ def batch_publish
user.unban
user_published << user.id
end
flash[:notice] = node_published.to_s + ' nodes published and ' + user_published.length.to_s + ' users unbanned.'
flash[:notice] = "#{node_published} nodes published and #{user_published.length} users unbanned."
redirect_to '/spam2'
else
flash[:error] = 'Only admins and moderators can batch publish.'
Expand All @@ -49,7 +49,7 @@ def batch_delete
node_delete += 1
node.delete
end
flash[:notice] = node_delete.to_s + ' nodes deleted'
flash[:notice] = "#{node_delete} nodes deleted"
redirect_back fallback_location: root_path
else
flash[:error] = 'Only admins and moderators can batch delete.'
Expand All @@ -66,7 +66,7 @@ def batch_ban
user_ban << user.id
user.ban
end
flash[:notice] = user_ban.length.to_s + ' users banned.'
flash[:notice] = "#{user_ban.length} users banned."
redirect_back fallback_location: root_path
else
flash[:error] = 'Only admins and moderators can ban users.'
Expand All @@ -83,7 +83,7 @@ def batch_unban
unbanned_users << user_unban.id
user_unban.unban
end
flash[:notice] = unbanned_users.length.to_s + ' users unbanned.'
flash[:notice] = "#{unbanned_users.length} users unbanned."
redirect_back fallback_location: root_path
else
flash[:error] = 'Only admins and moderators can unban users.'
Expand All @@ -99,7 +99,7 @@ def batch_ban_user
users << user_ban.id
user_ban.ban
end
flash[:notice] = users.length.to_s + ' users banned.'
flash[:notice] = "#{users.length} users banned."
redirect_back fallback_location: root_path
else
flash[:error] = 'Only moderators can moderate users.'
Expand Down Expand Up @@ -138,7 +138,7 @@ def batch_comment
flash[:notice] = 'Invalid Url'
end
end
flash[:notice] = comment_total.to_s + ' comments moderated.'
flash[:notice] = "#{comment_total} comments moderated."
redirect_back fallback_location: root_path
else
flash[:error] = 'Only admins and moderators can moderate comments.'
Expand Down