Merge pull request #4976 from dmacjam/fix_generate_posts
FIX: user is nil in populate command
This commit is contained in:
commit
ad0e43507b
|
@ -60,7 +60,8 @@ class Populate < Thor
|
||||||
private
|
private
|
||||||
|
|
||||||
def create_user(user_email)
|
def create_user(user_email)
|
||||||
unless User.find_by_email(user_email)
|
user = User.find_by_email(user_email)
|
||||||
|
unless user
|
||||||
puts "Creating new account: #{user_email}"
|
puts "Creating new account: #{user_email}"
|
||||||
user = User.create!(email: user_email, password: SecureRandom.hex, username: UserNameSuggester.suggest(user_email))
|
user = User.create!(email: user_email, password: SecureRandom.hex, username: UserNameSuggester.suggest(user_email))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue