Ruby on Rails Monday, July 11, 2016

No tutorial that I know of..

You have the same information for all user types, namely just the
important information for users. So - you keep password, username, first
name, last name, email address etc in the User table.

Stuff like sport, training ground, weight, height, body-fat etc would go
in a table like AthleticInfo

stuff like restaurant, food speciality, chef qualifications etc would go
in a table like ChefInfo

then if user1 is a chef, he would have all the user info + type Chef and
he would have an entry in the chef table

user2 if she was a footballer would have all the user info + type
Athlete and she would have an entry in the athlete table

So, you don't need to keep all the chef or athlete data in the user
table - you just have a reference to that info in the relevant table..

--
Posted via http://www.ruby-forum.com/.

--
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@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/1b9625c76a36d55a50ed2296311ec5e6%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment