I need your help
I have the following template:
class User < Ac...
enum user_type: [:normal, :admin]
end
I also have the "Department" template:
class Department < A....
end
What I need is to do the type relationship:
User belongs (belongs_to) to a Department, but only when the type is "admin"; And the Department must have (has_many) multiple users but only type "admin"
How can I specify this type of relationship?