Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20190509125709_fix_missing_remote_photo_fields.rb « migrate « db - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8d6462643b8c3fd74ae4e4d179abfeef9ec3d9af (plain)
1
2
3
4
5
6
7
8
9
10
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