我一直在寻找一种方法来搜索多个不相关的模型,这意味着正在搜索的模型之间没有关联,到目前为止我还没有找到任何关于如何执行此操作的文档。
这个想法是,我在每个页面上都有一个搜索表单,我希望用户能够搜索网站上存在的几个模型。有些模型是关联的,有些则没有。
例如
Ledgers, Plates, and Essays are related by ledger_id
Comments, and Galleries are related to Plates via plate_id
Discussions is not related or associated to any of the above
Products are not related or associated to any of the above
所有的表都有一个创建的字段。
所以我希望我的搜索表单能够搜索上面列出的所有表格,这些表格按创建的字段、分类帐、板块、论文、评论、画廊、讨论和产品...
关于如何用一组结果做到这一点的任何想法?