FIX: word_count wasn't working with non-latin sentences

This commit is contained in:
Régis Hanol
2016-01-11 11:16:23 +01:00
parent 61650edfd4
commit cf4cb2126a
4 changed files with 9 additions and 9 deletions

View File

@@ -172,7 +172,7 @@ class PostCreator
def self.before_create_tasks(post)
set_reply_info(post)
post.word_count = post.raw.scan(/\w+/).size
post.word_count = post.raw.scan(/[[:word:]]+/).size
post.post_number ||= Topic.next_post_number(post.topic_id, post.reply_to_post_number.present?)
cooking_options = post.cooking_options || {}