1 class AddImageUseGravatarToUsers < ActiveRecord::Migration[4.2]
2 class User < ApplicationRecord
6 add_column :users, :image_use_gravatar, :boolean, :null => false, :default => false
8 # For people who don't have images on osm.org, enable Gravatar.
9 User.where(:image_file_name => nil).update_all(:image_use_gravatar => true)
11 change_column_default :users, :image_use_gravatar, true
15 remove_column :users, :image_use_gravatar