Question

I 'm creating FaceBook like application and everything is centered around Person model. Status, Posts, Comments, Emails, Education, Employments, etc, are referenced to a Person model. Now I'm have an Account model created via devise to handle authentication. I'm not so sure how should I link between Person and Account! Should I replace Person with Account model and make reference to all other models? But, then difficulty I'm having is that all the actions will be generated by a Person, not an Account. I really like to separate Peron and Account. Account is suppose to really meant for authentication purposes only. One thing I'm thinking is to create a record in Person model, whenever an Account is registered. But then how do I override devise controller to insert a record in Person model? Any advise is greatly appreciated how to handle this situation.

Best REgards, AM.

Was it helpful?

Solution

I'd scrap (get rid of) Account, unless you are charging for your new fangled FAcebook app. NO need.

With Devise, you are authenticating the model Person, which can sign in without the need for an Account model for just that purpose.

you would make all of your other controller actions scope off of the current_person method. E.g., @status = current_person.status or @comments = current_person.comments

Only use the Account Model if they are paying for something, or you want more then ONE person to have access to that Person model. Which is weird in a facebook app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top