diff --git a/app/models/photo.rb b/app/models/photo.rb index 5a5dd1c9010c6540636d38d48bd6761c3578a521..8521c559751000178fe97c15f2d60311ab758f78 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -3,7 +3,7 @@ class Photo < Post include MongoMapper::Document mount_uploader :image, ImageUploader - xml_reader :remote_photo + xml_accessor :remote_photo xml_reader :album_id key :album_id, ObjectId @@ -23,10 +23,11 @@ class Photo < Post end def remote_photo - User.owner.url.chop + image.url + @remote_photo ||= User.owner.url.chop + image.url end def remote_photo= remote_path + @remote_photo = remote_path image.download! remote_path image.store! end