Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- User.create(email: 'test@example.com', encrypted_password: '#$taawktljasktlw4aaglj')
- user = User.new
- user.email = 'test@example.com'
- user.encrypted_password = '#$taawktljasktlw4aaglj'
- user.save!
- user.password = 'valid_password'
- user.password_confirmation = 'valid_password'
- user = User.create! :name => 'John Doe', :email => 'john@gmail.com', :password => 'topsecret', :password_confirmation => 'topsecret'
- def triggerSeedUsers
- p "Starting Seeding Users..."
- p "Deleting all users"..
- User.destroy_all
- normal_users = [{:email => 'abc@domain.com', :login => "abc_demo", :name => 'abc Demo'}]
- admin_users = [{:email => 'admin@domain.com', :login => 'abc_admin', :name => 'abc Admin'}]
- [normal_users,admin_users].each do |user_type|
- user_type.each do |user|
- User.create!(:name => user[:name],
- :login => user[:login],
- :email => user[:email],
- :first_login => false,
- :password => 'P@ssw0rd',
- :password_confirmation => 'P@ssw0rd'
- )
- end
- end
- User.where('name LIKE ?', '%demo%').update_all(:is_admin => 0)
- User.where('name LIKE ?', '%admin%').update_all(:is_admin => 1)
- end
- user = User.new(
- :email => "admin@xxxxx.xxx",
- :password => "123456",
- :password_confirmation => "123456"
- )
- user.skip_confirmation!
- user.save!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement