# Overall model /db design comments sought

**URL:** <https://www.ruby-forum.com/t/overall-model-db-design-comments-sought/186588>\
**Category:** Rails\
**Created:** [April 9, 2010, 9:49am UTC](https://www.ruby-forum.com/t/overall-model-db-design-comments-sought/186588 "2010-04-09T09:49:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [April 9, 2010, 9:49am UTC](https://www.ruby-forum.com/t/overall-model-db-design-comments-sought/186588/1 "2010-04-09T09:49:53Z")

</div>

Hi there,

Im wondering how to best go about this and would appreciate some general  
pointers etc.

Background:  
just a language learning site where users can can write posts both in  
their native language and the language they are learning.  
Users can view all the posts that are in their native language or the  
ones in the langauge they are learning.

I know i need a user and post models but do I also need a language one?

A user has many posts and a post belongs to a language  
A language has many posts  
is that right?

Should i be creating a relationhip between the language model and the  
user?  
A user has a _native_ language  
A user has a _foreign_ language

It doesnt sound right to me plus i dont even know how I could  
technically set that up as thats two “has a” to the same language model.

Instead I thought in my user objects Ill have two attributes, native  
language and foreign languge. When they write a post theyll specify if  
its in their native or foreign language. Then Controller-\>post\>create  
will take that option and do something like

@sentence = @user.post.build(params[:post])

How is the above app design???

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [April 9, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/overall-model-db-design-comments-sought/186588/2 "2010-04-09T15:10:11Z")

</div>

> Should i be creating a relationhip between the language model and the  
> user?  
> A user has a _native_ language  
> A user has a _foreign_ language

Hmm… could be a model question right there?

Users can have many foreign tongues (if I speak perhaps English, French,  
German and Russian)

Arguably, users can have multiple ‘native’ tongues… it depends on  
their frequency of usage I think.

So perhaps the distinction between native and foreign is a question of  
command of a particular language, which you could measure in some  
gradient (1 = Just learning, 10 = Expert) that the user would choose if  
you wanted users to be able to self-qualify their expertise.
