1 class AddUserImageFingerprint < ActiveRecord::Migration[5.0]
3 add_column :users, :image_fingerprint, :string, :null => true
5 User.where("image_file_name IS NOT NULL").find_each do |user|
8 user.image_fingerprint = image.generate_fingerprint(image)
14 remove_column :users, :image_fingerprint