From 3e2c9b4b94edbc41803c22a57e316cf42af1550b Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 11 Feb 2011 18:47:26 -0800 Subject: [PATCH] set photo-message relations based on guid on federation --- app/models/photo.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/photo.rb b/app/models/photo.rb index 11afaae6c..d169f8044 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -10,7 +10,7 @@ class Photo < Post xml_attr :remote_photo_name xml_attr :caption - xml_attr :status_message_id + xml_attr :status_message_guid belongs_to :status_message @@ -50,6 +50,14 @@ class Photo < Post photo end + def status_message_guid + self.status_message.guid + end + + def status_message_guid= new_sm_guid + self.status_message= StatusMessage.where(:guid => new_sm_guid).first + end + def url(name = nil) if remote_photo_path name = name.to_s + '_' if name