On Friday, May 24, 2013 10:55:53 PM UTC-4, Peter wrote:
>
> Can I please get everyone's opinion? Should customers and admins be on 
> separate tables? I'm developing an application that has two kinds of users, 
> a customer and an administrator.
>
> The application basically is a shopping cart. Customers from the internet 
> create their accounts so they are able to buy my products. But there are 
> also administrators (admins). Admins are my employees. They maybe call new 
> customers and try to sell them my products. They have the ability to 
> create, update and manage customers' accounts. Admins are able to buy 
> products for customers upon their request. I hope that makes sense.
>
> Given that admins and customers have different roles but are the same 
> objects, users, should they be in separate tables? Thank you.
>
>
I also prefer adding a boolean to the user table, but I can tell you I've 
seen a lot of cases where separate tables and controllers are created.  I 
use devise for authentication and the documentation clearly recommends 
separate tables and controllers.  I've never understood why, I just assumed 
their needs were more involved than mine, I've always just added the 
boolean and it's been pretty straightforward. 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/fc3d08c6-f5bd-44e0-b97a-d41e1aa71378%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to