Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AddBaseUser < ActiveRecord::Migration
- def self.up
- @adminRole = UserRole.new(:name => 'admin');
- @adminRole.save(false);
- @realtorRole = UserRole.new(:name => 'realtor');
- @realtorRole.save(false);
- @user = User.new(
- :login => 'admin',
- :name => 'admin',
- :email => 'admin@admin.com');
- @user.password = 'admin';
- @user.user_roles = UserRole.find_by_name('admin');
- @user.save;
- end
- def self.down
- end
- end
Add Comment
Please, Sign In to add comment