]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace ActionView::Helpers::TextHelper#truncate by String#truncate at Applic...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 6 Feb 2014 03:35:01 +0000 (03:35 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 6 Feb 2014 03:35:01 +0000 (03:35 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12835 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 9c2a622aca5b5e954c276c3723a5b83bf7768c14..25096a11defd4efa5e175e909d2b4238c8bdc4ac 100644 (file)
@@ -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]+/, "<br />").html_safe
   end