diff options
author | Alexey Vakhov <vakhov@gmail.com> | 2012-02-15 10:04:27 +0400 |
---|---|---|
committer | Alexey Vakhov <vakhov@gmail.com> | 2012-02-15 12:09:00 +0400 |
commit | 7f33a44ecdcc2960b33fe24e66f463fc5bfff136 (patch) | |
tree | 373025c1d6179f8091d15cca3fe80278a7e7b336 /actionmailer/lib | |
parent | 1c75b9afa0f2c5fe5e841103e7d7351a89e5873d (diff) | |
download | rails-7f33a44ecdcc2960b33fe24e66f463fc5bfff136.tar.gz rails-7f33a44ecdcc2960b33fe24e66f463fc5bfff136.tar.bz2 rails-7f33a44ecdcc2960b33fe24e66f463fc5bfff136.zip |
Fix AM format_paragraph helper method if a first word is long
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/mail_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb index 869c4dff4c..72314d81ad 100644 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ b/actionmailer/lib/action_mailer/mail_helper.rb @@ -41,7 +41,7 @@ module ActionMailer sentences = [[]] text.split.each do |word| - if (sentences.last + [word]).join(' ').length > len + if sentences.first.present? && (sentences.last + [word]).join(' ').length > len sentences << [word] else sentences.last << word |