bidirectional habtm linking

Posted by Alexey Poimtsev on Stack Overflow See other posts from Stack Overflow or by Alexey Poimtsev
Published on 2010-04-28T20:35:59Z Indexed on 2010/04/29 12:17 UTC
Read the original article Hit count: 365

Hi, all. I have application with 2 groups of models - content based (news, questions) and "something" based (devices, applications etc). I need to link all models between groups - for example question may belongs to 3 different things - one application and 2 devices. The same - for news. From other side - i need to see all news articles and questions related to some application or device.

Any idea how to develop this in rails? I have only one idea - mixins that will add methods content_id and thing_id to models and join table.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about activerecord