Class: DefaultUserModelMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/migrations/site/03_default_user_model.rb

Class Method Summary collapse

Class Method Details

.down(site) ⇒ Object



10
11
12
# File 'lib/migrations/site/03_default_user_model.rb', line 10

def self.down(site)
  site.default_users.destroy
end

.up(site) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/migrations/site/03_default_user_model.rb', line 2

def self.up(site)
  site.records.create_model :default_user do |default_users|
    add_field :name, :string, validations: {required: {}}
    add_field :email, :email, validations: {required: {}}
    add_field :password, :password, validations: {required: {}}
  end
end