Skip to content

Commit

Permalink
Update batch_controller.rb (#11521)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvyJeptoo authored Oct 21, 2022
1 parent 585a858 commit 91f5036
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 91f5036

Please sign in to comment.