set photo-message relations based on guid on federation
This commit is contained in:
parent
e43cd3a8da
commit
3e2c9b4b94
1 changed files with 9 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ class Photo < Post
|
||||||
xml_attr :remote_photo_name
|
xml_attr :remote_photo_name
|
||||||
|
|
||||||
xml_attr :caption
|
xml_attr :caption
|
||||||
xml_attr :status_message_id
|
xml_attr :status_message_guid
|
||||||
|
|
||||||
belongs_to :status_message
|
belongs_to :status_message
|
||||||
|
|
||||||
|
|
@ -50,6 +50,14 @@ class Photo < Post
|
||||||
photo
|
photo
|
||||||
end
|
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)
|
def url(name = nil)
|
||||||
if remote_photo_path
|
if remote_photo_path
|
||||||
name = name.to_s + '_' if name
|
name = name.to_s + '_' if name
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue