set photo-message relations based on guid on federation

This commit is contained in:
Raphael Sofaer 2011-02-11 18:47:26 -08:00
parent e43cd3a8da
commit 3e2c9b4b94

View file

@ -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