Logging for the differing id problem in remote photos
This commit is contained in:
parent
2f35d07807
commit
e754e97c7e
1 changed files with 4 additions and 0 deletions
|
|
@ -21,14 +21,18 @@ class Photo < Post
|
|||
photo.image.store! image_file
|
||||
photo
|
||||
end
|
||||
|
||||
after_save {Rails.logger.info("After saving now the id is #{id}"
|
||||
|
||||
def remote_photo
|
||||
@remote_photo ||= User.owner.url.chop + image.url
|
||||
end
|
||||
|
||||
def remote_photo= remote_path
|
||||
Rails.logger.info("Setting remote photo with id #{id}")
|
||||
@remote_photo = remote_path
|
||||
image.download! remote_path
|
||||
image.store!
|
||||
Rails.logger.info("Setting remote photo with id #{id}")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue