#941 ✓resolved

DataMapper Ignores Conditions on Associations With :lazy => false

Reported by Pugio | July 1st, 2009 @ 11:53 AM | in 0.10.2

Full example: http://gist.github.com/138888

This is using 0.10.0.

Comments and changes to this ticket

  • Martin Gamsjaeger (snusnu)

    Martin Gamsjaeger (snusnu) July 21st, 2009 @ 06:33 PM

    • Assigned user set to “Dan Kubb (dkubb)”
    • State changed from “new” to “confirmed”

    Running the attached code with latest next branches gives me two times 14, and not 14 and then 8 as the attached code mentions. Both is wrong though, it should give two times 8. The funny thing however is, that when I change the property type from Object to Integer (or String, or probably anything else than Object) it gives me two times 8, which is correct.

    So while I can confirm that the attached code doesn't behave as expected, I'm not really sure wether the ticket title holds and this really has something to do with :lazy => false in general?

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) July 22nd, 2009 @ 03:56 PM

    • State changed from “confirmed” to “accepted”
  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM

    • Milestone changed from 0.10.0 to 0.10.2

    [project:id#20609 not-tagged:"0.10.0" milestone:id#51895 bulk edit command]

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) October 24th, 2009 @ 04:48 AM

    I actually think this has to do with the way Object is serialized. The query says that they want to search for all the records that are nil, but Marshal will serialize a nil as a string, so nothing matches.

    I don't know what the solution to this is, whether or not we should take the abstract search, and then marshal all the values to whatever would be stored, and search using that. It sounds like the right thing to do since I don't think it would have any negative side effects, but I have to think about this more.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) October 24th, 2009 @ 04:56 AM

    Wait, nevermind, I don't think that's it. This is a bug that will require more investigation before we know what is wrong.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 10th, 2009 @ 02:33 AM

    • State changed from “accepted” to “resolved”

    This ticket is now resolved on edge dm-core. The value of 8 is returned. There were recent fixes to queries involving nil, as well as ensuring that Object was serialized to a nil value, instead of Marshaled into a String and then saved.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »