Skip to content

Commit

Permalink
Merge pull request consuldemocracy#3756 from consul/fix_duplicate_use…
Browse files Browse the repository at this point in the history
…rnames_in_dev_seeds

Fix duplicate usernames in dev seeds task
  • Loading branch information
javierm committed Oct 9, 2019
2 parents 0b0c4a2 + 47c0bfc commit 3cc5d30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/dev_seeds/users.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
section "Creating Users" do
def create_user(email, username = Faker::Name.name)
def create_user(email, username)
password = "12345678"
User.create!(
username: username,
Expand Down Expand Up @@ -79,12 +79,12 @@ def unique_document_number
end

5.times do |i|
official = create_user("official#{i}@consul.dev")
official = create_user("official#{i}@consul.dev", "Official #{i}")
official.update(official_level: i, official_position: "Official position #{i}")
end

30.times do |i|
user = create_user("user#{i}@consul.dev")
user = create_user("user#{i}@consul.dev", "Regular user #{i}")
level = [1, 2, 3].sample
if level >= 2
user.update(residence_verified_at: Time.current,
Expand Down

0 comments on commit 3cc5d30

Please sign in to comment.