First of all, Merry Christmas all! What I've been trying to do is real simple (in theory). I have a Devise authentication system that runs with Mongoid as it's ODM. What I want to do is associate certain users with another user where one user is the "parent" of the other "children" users. Think parental controls - there is one parent that has an account and then all of their children are associated with the parent account. The parent account then has a special "parent" role which gives them parental control (or administrative rights) over their children. Same concept here only I'm trying to emulate this in Devise with Mongoid as the ODM. Can Can will be used later for authorization.
The first solution I thought of was to embed the children in the parent account. I do not want to solve this with embedding as I don't see the benefit. If someone could enlighten me as to the benefit of solving this question with embedding, please do. I was thinking about having something like has_many :users instead. Where this may become a problem is can a User really have many users in Devise + Mongoid?
The other thing I was thinking about doing was having Parent and Student models inheriting from the User model (the one with Devise in it). I did not know if that would work with Devise 1.x (and 2.x in the future) considering that I'd be inheriting from a Devise model. If you've tried that before, please let me know your experiences.
With that long-winded explanation done, your thoughts?
-Robert
Using Rails 3.1.x, Devise 1.5.x, and Mongoid 2.3.x