Remove pro role from users and database (#13176)

This commit is contained in:
Vaidehi Joshi 2021-03-31 09:34:10 -07:00 committed by GitHub
parent 38aa5bd96c
commit 52b3d47a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,12 @@
module DataUpdateScripts
class RemoveProRoles
def run
pro_role = Role.find_by(name: "pro")
return unless pro_role
pro_role.users.find_each { |u| u.remove_role(:pro) }
pro_role.destroy
end
end
end