weixin_39782500 2020-11-22 01:58
浏览 0

Many-To-Many Relationships not working across multiple repositories

The following code is capable of reproducing the issue:

http://pastie.org/private/rsdhjt2chy2a15ycqfei0a

In this case, two of the models exist in the :default repository, the other exists in :inventory. Various combinations of repository() {} blocks vs. inline :repository => repository() attributes on the associations, changing :child_key to :target_key, etc...all fail with various other exceptions.

If I've defined the associations incorrectly, I apologize. This looks like it should work, but I have had no luck in 0.10 or prior. If there's any other information I can provide, please let me know. Thanks!

Created by Matt Savona - 2009-06-26 13:01:17 UTC

Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/925

该提问来源于开源项目:datamapper/dm-core

  • 写回答

8条回答 默认 最新

  • weixin_39782500 2020-11-22 01:58
    关注

    Attached is a script demonstrating how I would set it up. There is still a problem there, but hopefully this will provide a better example of how to set up cross-repository relationships.

    The remaining problem is mostly due to the Query not recognizing that some of the relationships are from different repos, so it constructs a 3 table join to pull back the results, rather than breaking it up when going from Vip -> Interface.

    by Dan Kubb (dkubb)

    评论

报告相同问题?