fix old photos without a remote_photo_path or remote_photo_name
closes #8012
This commit is contained in:
parent
39b86ed486
commit
2d23a2601e
2 changed files with 14 additions and 0 deletions
|
|
@ -4,6 +4,9 @@
|
|||
* Enable paranoid mode for devise [#8003](https://github.com/diaspora/diaspora/pull/8003)
|
||||
* Refactor likes cucumber test [#8002](https://github.com/diaspora/diaspora/pull/8002)
|
||||
|
||||
## Bug fixes
|
||||
* Fix old photos without remote url for export [#8012](https://github.com/diaspora/diaspora/pull/8012)
|
||||
|
||||
## Features
|
||||
* Add a manifest.json file as a first step to make diaspora\* a Progressive Web App [#7998](https://github.com/diaspora/diaspora/pull/7998)
|
||||
* Allow `web+diaspora://` links to link to a profile with only the diaspora ID [#8000](https://github.com/diaspora/diaspora/pull/8000)
|
||||
|
|
|
|||
11
db/migrate/20190509125709_fix_missing_remote_photo_fields.rb
Normal file
11
db/migrate/20190509125709_fix_missing_remote_photo_fields.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class FixMissingRemotePhotoFields < ActiveRecord::Migration[5.1]
|
||||
def up
|
||||
Photo.where(remote_photo_path: nil).each do |photo|
|
||||
photo.write_attribute(:unprocessed_image, photo.read_attribute(:processed_image))
|
||||
photo.update_remote_path
|
||||
photo.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue