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

Association problem with subclasses

When using 'has n' for a class with deriatives, the deriatives aren't loaded properly.

Example at http://kiasyn.pastebin.com/m34bff3b3

Created by Kiasyn - 2009-06-15 07:33:08 UTC

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

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

  • 写回答

6条回答 默认 最新

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

    This is an interesting problem. It happens because the association links to the Item model, so when the query is generated it uses the Item model’s default properties (which is just name and type).

    While it might be possible to generate the Query using the default properties for all of Item’s descendants, we will also need to make sure to ignore properties from Sibling model when initializing the object inside Model#load.

    by Dan Kubb (dkubb)

    评论

报告相同问题?