markevans/dragonfly — Issue #166: photo_uid_was not set to the right value in after_update/before_update
Author: ericmnel
Created: 2012-01-28 17:22:51+00:00
State: open

I have an after_update filter in my model to notify all my contacts if my photo has changed:

before_update :check_for_name_or_photo_update

def check_for_name_or_photo_update

# if our name or photo changes, tell all our contacts to do a full friend
# list update

INFO_LOG.create "@@@ " + self.photo_uid
INFO_LOG.create "@@@ " + self.photo_uid_was

if ((self.name != self.name_was) ||
(self.photo_uid != self.photo_uid_was))

touch_friend_accounts
end

true
end

It seems to work for the name field, but the photo_uid and photo_uid_was fields are always the same value:

run 1:
@@@ 2012/01/28/10/21/24/110/tiger.jpg
@@@ 2012/01/28/10/21/24/110/tiger.jpg

run 2:
@@@ 2012/01/28/10/22/02/621/tiger.jpg
@@@ 2012/01/28/10/22/02/621/tiger.jpg