Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. wrote: >> I haven't looked at AS internals for a few months now, but right now the >> following seems to be a help >> >> - Rails tracks modified models and fields, so we can stop tracking that >> internally >> > > I'm not sure about this, where do we track modified models? Mabye you are > thinking about attributes_hash_is_empty?, but if we can use the new nested > forms I think that method wouldn't be necessary. >
Check /lib/extensions/unsaved_*.rb I think right now we have some logic in AS to track dirty models and associations. This has had to jump through various hoops in the past, eg not saving an associated record where there are some default values for columns (AS had a bug at one point which would cause it to keep creating records in this event - not sure if this is worked around now?) By using rails 2.x tracking of dirty/unsaved attributes we can do clever stuff like not changing nulls to "" in string values and avoiding saving records which haven't really changed even though we may have some values back which are not empty. Also the dirty tracking may be more robust in edge cases such as callback triggers updating related records (this happens for me and I need to force AR to save my related tables as a result - all in a transaction so no big deal, but would be nice is AS handled it for me) I don't think it's actually a very large change - I think it would simplify the save code because we can just iterate over stuff which needs saving and dump code. However, I haven't looked through this for quite a while now... Good luck Ed W --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
