If all model`s properties are translatable, or translatable properties could be extracted into separate model, there is a simple way like: define the 'language-mirrorer' model, eg. link, with associations like "link has n, :translatable_articles", and define translatable_article`s property eg. locale. So, now we can get article with link.translatable_articles.first(:locale => ...), with variations and lazy loading for preventing load hell.
In case of many translatable models, links can be common or STI-fied from one model. This way requires some data, provided to plugin: name of property, where locale will be stored, and the name of model, which will be used as 'language-mirrorer'. We already used this scheme in AR-based project. IMHO in this case difference between AR and DM is insignificantly. P.S. Sorry for my english... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
