Hi all. I just updated this ticket: http://datamapper.lighthouseapp.com/projects/20609-datamapper/tickets/770-dm-validations-sti-causes-updates-to-fail#ticket-770-2
The problem is worse than we thought. Basically, STI is not reliable, because setting a field in the derived class can wipe out fields in the base class due to an errant lazy load. See the ticket for details. I need to fix this bug, because I am relying on STI in my app and there is no reliable workaround. I am going to try and nail it this morning. If anyone has any insight on where to start looking, let me know. I will also try the latest version in github and see if anything has changed. ..tony.. On Wed, Jan 14, 2009 at 4:38 PM, Gary Yngve <[email protected]> wrote: > hoping to save some folks a major headache.. took me far too long to > isolate this bug.. haven't delved too much into finding a fix yet, but it > probably gets deep into Query > > basically if you have a subclass that adds a property, in the process of an > update in the parent, it queries the unloaded subclass property, also > reloading the other properties (a similar thing has happened w/ lazy), > causing your change to disappear before it issues the update. (and having > an association in a subclass constitutes adding a property) > > see my two Lighthouse tickets from today for more info and repro scripts.. > > http://datamapper.lighthouseapp.com/projects/20609/tickets/767-child-property-creeps-into-parent-query-sti#ticket-767-1 > > http://datamapper.lighthouseapp.com/projects/20609/tickets/770-dm-validations-sti-causes-updates-to-fail#ticket-770-1 > > i've had mixed success with adding :auto_validation => false to all new > subclass properties; works in a simple script but not in our merb project. > > -gary > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
