Skip to content

Commit

Permalink
Fix user seeds not populating from pwned_password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bennpham authored and julianguyen committed Sep 16, 2024
1 parent 306e300 commit 55115b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
.idea/
.tags
*.swp
.tool-versions

# Ignore coverage results
/coverage
Expand Down
11 changes: 7 additions & 4 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
# Mayor.create(name: 'Emanuel', city: cities.first)

# Users
user1 = User.create(name: 'Test1 Lastname', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada', about: 'Hi my name is Test1! I want to use the site so that I can improve the way I handle my anxiety.')
user2 = User.create(name: 'Test2 Lastname', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada')
user3 = User.create(name: 'Test3 Two-Lastnames', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States')
user4 = User.create(name: 'Admin User', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States', admin: true)
user1 = User.new(name: 'Test1 Lastname', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada', about: 'Hi my name is Test1! I want to use the site so that I can improve the way I handle my anxiety.')
user2 = User.new(name: 'Test2 Lastname', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada')
user3 = User.new(name: 'Test3 Two-Lastnames', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States')
user4 = User.new(name: 'Admin User', email: '[email protected]', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States', admin: true)

## Save with validate: false to bypass pwned_password data breach check for seeding users
[user1, user2, user3, user4].each { |user| user.save!(validate: false) }

# Allies
Allyship.create(user_id: user1.id, ally_id: user2.id, status: :accepted)
Expand Down

0 comments on commit 55115b4

Please sign in to comment.