Re: question about automagic 'modified' field

2010-01-27 Thread Zaky Katalan-Ezra
You can write trigger in the database On Mon, Jan 25, 2010 at 5:25 PM, Javier wrote: > Is it possible to automagically update 'modified' field in a > 'belongsTo' table when a table is updated. > > my example is this: I have two tables with 'modified' > fields...'families' and 'family_members'. mo

Re: question about automagic 'modified' field

2010-01-26 Thread Javier
Thank you for the suggestion. I tried creating a parent behavior, but, proved too complex for a newbie like me. Instead I just handled it the afterSave() of the "child" method. I just force the update of the 'modified' field there. I'll work on a more generic way to do this when I have more cake ex

Re: question about automagic 'modified' field

2010-01-25 Thread euromark
i would use a behavior "ModifyUpdatable" or something that checks if there are any "parent relations" and if so triggers the update of the timestamps for performance issues you could manually define the parent relations to be modified so it can update right away instead of checking on existing "mo

question about automagic 'modified' field

2010-01-25 Thread Javier
Is it possible to automagically update 'modified' field in a 'belongsTo' table when a table is updated. my example is this: I have two tables with 'modified' fields...'families' and 'family_members'. models are Family hasMany FamiyMember, FamilyMember belongsTo Family. When I edit an existing fam