You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class User < ApplicationRecord
include RoleModel
roles ...
DELETED_ROLES = [...]
I have to keep the original list of roles, even if I remove one. Can I somehow "ovveride" the self.valid_roles, so that it is something like roles self.valid_roles - DELETED_ROLES array inside the User class?
The text was updated successfully, but these errors were encountered:
If you define it in your User class, you should be able to refer to
role_model‘s implementation as super.valid_roles. (The „include“
effectively inserts role_model methods into the inheritance chain, so
something like this should work, but I haven’t tested it – let me know how
it goes.)
On Fri 3. Nov 2023 at 14:26, ArminBeda ***@***.***> wrote:
If I have something like the following structure:
class User < ApplicationRecord
include RoleModel
roles ...
DELETED_ROLES = [...]
I have to keep the original list of roles, even if I remove one. Can I
somehow "ovveride" the self.valid_roles, so that it is something like roles self.valid_roles
- DELETED_ROLES array inside the User class?
—
Reply to this email directly, view it on GitHub
<#42>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADCATDD646AHFLWRVLRG3YCTWHBAVCNFSM6AAAAAA64N4IYGVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TMMRQGM3TKMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
If I have something like the following structure:
I have to keep the original list of roles, even if I remove one. Can I somehow "ovveride" the self.valid_roles, so that it is something like roles
self.valid_roles - DELETED_ROLES
array inside the User class?The text was updated successfully, but these errors were encountered: