I am building an application where users are distributed among different user groups (User has_many UserGroup). But there is a specific type of User (admin) that I would like to belong to ALL groups. I know I can add them to the group on the after_create or after_update method of UserGroup, but I would like to do something different.
My question is:
Is it possible that user.user_groups return all groups if the user is an admin, and the normal group list if he is not? Admin is a boolean field of User.
if you need more info, please let me know.