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

Save returns false after assigning existing value to a lazy Text property

Given a model with lazy Text property, if an instance of the model is loaded (but with the Text property not loaded because of laziness), if you assign to the property the value already stored in the db, attempting to save the object will return false.

If there is one or more lazy Text properties in the model, assigning to any of them a value other than the original value will cause save to return true.

I have only tested/observed this issue with MySQL.

Created by MarkMT - 2009-10-22 16:21:37 UTC

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

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

  • 写回答

9条回答 默认 最新

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

    I think this is because the database says 0 rows were affected if the data hasn’t actually changed. Perhaps the unloaded field should be loaded and verified as being truly dirty before saving?

    by Angel N. Sciortino (angelic)

    评论

报告相同问题?