Guest User

Untitled

a guest
Apr 16th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #put this in lib/tasks/import.rake
  2.  
  3. namespace :db do
  4.  
  5. desc "Prepares your database by loading default data"
  6. task :setup => :environment do
  7. # create the admin user
  8. admin_user = User.create(:login=>"admin", :password=>"admin", :password_confirmation=>"admin", :email =>"admin@yourdomain.com")
  9.  
  10. # create the admin role and assign it to the user
  11. admin_role = Role.create(:name=>"admin")
  12. admin_user.roles << admin_role
  13.  
  14. end
  15.  
  16. end
Add Comment
Please, Sign In to add comment