Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CreateUsers < ActiveRecord::Migration
- def self.up
- create_table "users", :force => true do |t|
- t.string :login, :email, :remember_token, :first_name, :last_name, :limit => 100
- t.boolean :admin, :super
- t.string :crypted_password, :limit => 40
- t.string :password_reset_code, :limit => 40
- t.string :salt, :limit => 40
- t.string :activation_code, :limit => 40
- t.datetime :remember_token_expires_at, :activated_at, :deleted_at, :created_at, :updated_at
- t.string :state, :null => :no, :default => 'passive'
- t.timestamps
- end
- add_index :users, :login, :unique => true
- # Create a super user
- User.create!(:login => 'suadmin',
- :email => "youradminemail@somedomain.com",
- :first_name => 'Super',
- :last_name => 'User',
- :password => "your_admin_password",
- :password_confirmation => "your_admin_password")
- # Create a test user
- User.create!(:login => 'testuser',
- :email => "yourtestemail@somedomain.com",
- :first_name => 'Test',
- :last_name => 'User',
- :password => "your_test_password",
- :password_confirmation => "your_test_password")
- # Activate accounts after observer calls
- @suadmin = User.suadminmake(1)
- @testuser = User.force_activate_now(2)
- end
- def self.down
- drop_table "users"
- end
- end
Add Comment
Please, Sign In to add comment