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