Anthro Christian Ramsey
2014-May-14 15:21 UTC
Modelling multiple types of users with Devise and Rails 4
I have 3 types of "users" Shop Provider Customer The last 2 users will have similar attributes such as First Name Last Name and so on And the Shop user type will have the most contrast between types. As far as behaviours they will all be quite different, although Provider and Shop will inherent many of customer behaviours. It seems the behaviours can be dealt with CanCan as I've researched. I'm now attempting to how I should authenticate these types. I have looked at the STI model but I couldn't grasp where I would these extra attributes. My mental model is as follower: User is a table and model The types are abstract models that inherit from this. So I'm wondering, how do I add attributes such as Business address for just the Shop type? Or is it that the User Table has a column called Type and that type is associated with these type tables? And within the type tables are the extra attributes? -- 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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f3510fb8-c153-4b94-bc82-4b3fd20459dd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.