Trading buttons: Buy, Sell, Exchange

First take a backup of your site in case anything goes wrong. Then:

# Get the category and assign it to a variable
c = Category.find_by(name: "<your category name>")

# Unmute the category for all users
CategoryUser.where(category_id: c.id, notification_level: 0).destroy_all

Edit:
If you’d like to see how many users the category has been muted for, before running the second command, try running

CategoryUser.where(category_id: c.id, notification_level: 0).count

That will return a count of users who have the category muted.

3 Likes