From 8934e790fe43721f8b9d55745869362d521df3bb Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 6 Feb 2014 03:35:01 +0000 Subject: [PATCH] Rails4: replace ActionView::Helpers::TextHelper#truncate by String#truncate at ApplicationHelper#format_activity_description git-svn-id: http://svn.redmine.org/redmine/trunk@12835 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c2a622ac..25096a11d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -232,7 +232,7 @@ module ApplicationHelper end def format_activity_description(text) - h(truncate(text.to_s, :length => 120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...') + h(text.to_s.truncate(120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...') ).gsub(/[\r\n]+/, "
").html_safe end -- 2.39.5