There's a way to get which fields were modified after a update query?
I want to keep track what field XXX user modified... any ways using active records?
There's a way to get which fields were modified after a update query?
I want to keep track what field XXX user modified... any ways using active records?
instructions:
SELECT
row, that user wants to modifyUPDATE
itsimple
There is no way using active record to get this easily, but if you are only supporting one specific database type (let's say MySQL) you could always use Triggers?
Or, Adam is about right. If you have a WHERE criteria for your UPDATE you can SELECT it before you do the UPDATE then loop through the old and new versions comparing.
This is exactly the sort of work Triggers were created for, but of course that puts too much reliance on the DB which makes this less portable yada yada yada.