Sha256: 2005ccd9bcc52d2ea6276296828835529bede5285e4077312e67a6a24094d2fc
Contents?: true
Size: 444 Bytes
Versions: 15
Compression:
Stored size: 444 Bytes
Contents
class AddRoleToUsers < ActiveRecord::Migration[5.2] def up add_column :users, :role, :integer, default: 0 User.where(admin: true).each do |user| user.update_attribute(:role, :admin) end User.where(admin_limited_access: true).each do |user| user.update_attribute(:role, :admin_limited_access) end remove_column :users, :admin, :boolean remove_column :users, :admin_limited_access, :boolean end end
Version data entries
15 entries across 15 versions & 1 rubygems