Hi im making a small site to help me and friends learn languages. Typical use:
Adam is english but is learning japanese. Adam can practice his japanese by writing and submitting articles written in japanese. Adam cant (not allowed to) submit any articles written in his native language. Adam can read articles (written in English) by other users who are learning English
Im trying to think how to model this and its proving to be more difficult than the standard rails has many belongs to associations that I`m accustomed to.
Ill need functionality like
-show all articles written in adams native language
@adam.native_language.articles
-show all posts written by users just like adam (i.e. learning the same language)
@adam.foreign_language.articles
-perhaps showing all posts written by language learners in one particular language
@language => Japanese
@langauge.posts
I need a user, article and language model. But how do i associate the language and user models? It feels like language should be associated twice to the user model, once for native_language and once for foreign_language.