Sha256: 9f01ae6626c6f2d00d8bd47df64fa553a63f5310aee1da7ab96cad47c8d9617d
Contents?: true
Size: 385 Bytes
Versions: 7
Compression:
Stored size: 385 Bytes
Contents
# frozen_string_literal: true class AddNicknameToManagedUsers < ActiveRecord::Migration[5.2] class User < ApplicationRecord self.table_name = :decidim_users end def up User.where(managed: true, nickname: nil).includes(:organization).find_each do |user| user.nickname = User.nicknamize(user.name, organization: user.organization) user.save end end end
Version data entries
7 entries across 7 versions & 1 rubygems