Sha256: 77cf3d7360ffdaa43bf82b98308ec92a7c1939bda97a7524fa585d42fbeed486

Contents?: true

Size: 306 Bytes

Versions: 13

Compression:

Stored size: 306 Bytes

Contents

# frozen_string_literal: true

class AddAdminToUsers < ActiveRecord::Migration[4.2]
  def self.up
    add_column :users, :admin, :boolean, null: false, default: false
    superuser = User.first
    superuser&.update_attribute(:admin, true)
  end

  def self.down
    remove_column :users, :admin
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fat_free_crm-0.22.1 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.22.0 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.21.0 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.20.1 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.20.0 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.19.2 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.19.0 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.18.2 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.17.3 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.18.1 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.18.0 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.17.2 db/migrate/20100928030618_add_admin_to_users.rb
fat_free_crm-0.17.1 db/migrate/20100928030618_add_admin_to_users.rb