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

20190703231700_fix_pending_profile_photos.rb « migrate « db - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 51b3a1512ae999a20712a3bc3aa4835af25ce8b7 (plain)
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

class FixPendingProfilePhotos < ActiveRecord::Migration[5.1]
  def up
    Photo.where(pending: true).each do |photo|
      photo.update(pending: false) if Profile.where(image_url: photo.url(:thumb_large)).exists?
    end
  end
end