Class: AddDefaultAdminUser

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/branston/db/migrate/20100812143455_add_default_admin_user.rb

Class Method Summary collapse

Class Method Details

.downObject



14
15
# File 'lib/branston/db/migrate/20100812143455_add_default_admin_user.rb', line 14

def self.down
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/branston/db/migrate/20100812143455_add_default_admin_user.rb', line 2

def self.up
  u = User.new
  u. = "admin"
  u.password = "password"
  u.password_confirmation = "password"
  u.email = "[email protected]"
  u.state = "active"
  u.activated_at = Time.now
  u.is_admin = true
  u.save!
end