diff --git a/db/migrate/010_add_admin_and_roles.rb b/db/migrate/010_add_admin_and_roles.rb --- a/db/migrate/010_add_admin_and_roles.rb +++ b/db/migrate/010_add_admin_and_roles.rb @@ -1,9 +1,16 @@ class AddAdminAndRoles < ActiveRecord::Migration + + def self.up root = User.new(:login => 'root', :full_name => 'Administrator', :alias => 'root') root.password = 'ioionrails'; + + class << root + public :encrypt_new_password + end + root.encrypt_new_password role = Role.create(:name => 'admin')