Create account roles with lock to avoid duplicates
This commit is contained in:
parent
77568c425e
commit
f96cd44c3b
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ class Account < ApplicationRecord
|
|||
self.class.define_dynamic_method role.name, resource
|
||||
end
|
||||
|
||||
roles << role
|
||||
account_roles.where(role: role).first_or_create!
|
||||
|
||||
role
|
||||
end
|
||||
|
|
Reference in a new issue