George, Calling #update on a dirty resource indeed raises an error and that is the expected dm behavior (it's got nothing to do with my plugin). If you find yourself updating the attributes of a resource in different places before persisting it, you should use #save instead of #update. This is probably confusing to some people, because #update only started to raise that error with recent versions of dm. I'm not sure if it was introduced in 0.10.1 or 0.10.2, but iirc, it wasn't present in 0.10.0 and definitely not in 0.9.x.
cheers snusnu On Fri, Mar 12, 2010 at 16:43, George <[email protected]> wrote: > Am using snusnu's excellent "dm-accepts_nested_attributes" plugin but > getting an error when submitting a form to update a "Trip" object: > > "Update Conflict Error 500 TripClient#update cannot be called on a > dirty resource" > > trips are related to clients through trip_clients > and the Trip model accepts_nested_attributes_for :trip_clients > (to allow a couple of extra fields to be set on each association, such > as 'is_invoicable') > > It saves fine if I only save changes to fields in trip_clients, but > the error crops up if I also submit changes to the trip object at the > same time. > > Any ideas why? > > Many thanks, > George > > -- > 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. > > -- 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.
