From 8e5ffcc0a37f4007612b023c582f7ee448434228 Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 17 Oct 2024 22:49:04 +0100 Subject: [PATCH] Fix default role name migration --- db/data/20240830151650_rename_default_roles.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/data/20240830151650_rename_default_roles.rb b/db/data/20240830151650_rename_default_roles.rb index f158aa623..d6a2a8cd6 100644 --- a/db/data/20240830151650_rename_default_roles.rb +++ b/db/data/20240830151650_rename_default_roles.rb @@ -2,8 +2,8 @@ class RenameDefaultRoles < ActiveRecord::Migration[7.1] def up - Role.find_by(name: :editor)&.update!(name: :moderator) - Role.find_by(name: :viewer)&.update!(name: :member) + Role.find_by(name: :editor)&.update!(name: :moderator) unless Role.find_by(name: :moderator) + Role.find_by(name: :viewer)&.update!(name: :member) unless Role.find_by(name: :member) end def down