Sub accounts

I am using restful authentication and was wondering if anyone has had
any experience with sub accounts. Basically, I want a user to have the
ability to add another user(s) to his/her account. So if user A
creates an account I would like them to have the ability to add new
users to their account - B, C, etc. B and C would “belong” to A and if
A’s account is deleted so is B and C. Makes sense? Any information on
how to achieve this would be greatly appreciated.

mlittle wrote:

I am using restful authentication and was wondering if anyone has had
any experience with sub accounts. Basically, I want a user to have the
ability to add another user(s) to his/her account. So if user A
creates an account I would like them to have the ability to add new
users to their account - B, C, etc. B and C would “belong” to A and if
A’s account is deleted so is B and C. Makes sense? Any information on
how to achieve this would be greatly appreciated.

This can be done by using the relationships among the tables.
I suggest the following database model:

Users ( Table )

ID
Name

sub_users ( Table)

ID references Users(ID)
UserID

In the models

Users => has_many :sub_users
sub_users => belongs_to :User

so, you should delete first sub_users records, then Users table records.

On Mar 21, 10:33 pm, Loganathan G. [email protected] wrote:

I suggest the following database model:
UserID

In the models

Users => has_many :sub_users
sub_users => belongs_to :User

so, you should delete first sub_users records, then Users table records.

Posted viahttp://www.ruby-forum.com/.

Seems too easy :). How would I handle the confirmation email and
related issues? Thanks a bunch for the response. I do appreciate it!!

mlittle wrote:

On Mar 21, 10:33�pm, Loganathan G. [email protected] wrote:

I suggest the following database model:
UserID

In the models

Users � => has_many :sub_users
sub_users => belongs_to :User

so, you should delete first sub_users records, then Users table records.

Posted viahttp://www.ruby-forum.com/.

Seems too easy :). How would I handle the confirmation email and
related issues? Thanks a bunch for the response. I do appreciate it!!

I don’t really understand what are you trying to mean about confirmation
email and related issues ?
If u don’t mind can u explain me in detail?

Thanks

Anyone else able to provide me with some insight on implementing this?

On Mar 21, 10:46 pm, Loganathan G. [email protected] wrote:

so, you should delete first sub_users records, then Users table records.
Thanks

Posted viahttp://www.ruby-forum.com/.

I’m going to look at the code more but I was talking about creating
the user just like I would with restful_authentication. I see what you
are saying but I am still not clear how the new user in sub_user would
be able to login, logout, and basically do the same as the users in
Users.