You know you're a code snob when April 9, 2014
Today I wrote a method that takes an updated object from the server and merges it with the current user's objects. These objects are in an hierarchy of client -> environment -> credentials. So I wrote a function that sees that a credential has been updated (deleted, inserted, updated), finds the client and environment that it belongs to, if it doesn't have it, it "pushes" it, otherwise if it's not a delete, it updates it, and if it's a delete it removes it. The other users can be editing clients or environments as well, so these have to work the same way.
The commit message for this change is as follows:
Update other users' data with data updated from the server. Need to clean up the compare function, in client controllers line 65 to 118
Yep, 53 lines of non-trivial code and I'm all like "That is WAY too long..." I will write a generic utility function that will do it for me. I found angular.copy to be very useful, I just need something to tell me what's changed.