You can make this line as below. It is faster and readable.
```ruby
FactoryGirl.create_list(:user, 20, username: "name#{num}", email: "name#{num}@example.com")
```