mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
DEV: prevents populate task to crash (#8111)
Generated emails/names/sentences were crashing with the following error: ``` Can not transliterate strings with ASCII-8BIT encoding ```
This commit is contained in:
parent
301c5a303f
commit
cb8fa46970
@ -102,11 +102,13 @@ class Populate < Thor
|
||||
end
|
||||
|
||||
def generate_sentence(num_words)
|
||||
hipster_words.sample(num_words).join(' ').capitalize + '.'
|
||||
sentence = hipster_words.sample(num_words).join(' ').capitalize + '.'
|
||||
sentence.force_encoding('UTF-8')
|
||||
end
|
||||
|
||||
def generate_email
|
||||
hipster_words.sample.delete(' ') + '@' + hipster_words.sample.delete(' ') + '.com'
|
||||
email = hipster_words.sample.delete(' ') + '@' + hipster_words.sample.delete(' ') + '.com'
|
||||
email.delete("'").force_encoding('UTF-8')
|
||||
end
|
||||
|
||||
def image_posts
|
||||
|
Loading…
Reference in New Issue
Block a user