Remove pro role from users and database (#13176)
This commit is contained in:
parent
38aa5bd96c
commit
52b3d47a04
1 changed files with 12 additions and 0 deletions
12
lib/data_update_scripts/20210329172336_remove_pro_roles.rb
Normal file
12
lib/data_update_scripts/20210329172336_remove_pro_roles.rb
Normal 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
|
||||
Loading…
Add table
Reference in a new issue