Class: UsersMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/migrations/site/01_users_model.rb

Class Method Summary collapse

Class Method Details

.down(site) ⇒ Object



21
22
# File 'lib/migrations/site/01_users_model.rb', line 21

def self.down(site)
end

.up(site) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/migrations/site/01_users_model.rb', line 2

def self.up(site)
  site.users.modify do |users|
    remove_field :email
    add_field :email, :alias, of: :username
    
    remove_field :first_name
    remove_field :last_name
    remove_field :name
    add_field :name, :string
    
    add_field :title, :alias, of: :name
    users.add_mixin site.pages
    
    add_many  :sites
    
    users.record_class_name = 'ProductionUser'
  end
end