]> 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:33:51 +0000 (03:33 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 6 Feb 2014 03:33:51 +0000 (03:33 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12831 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index e2e3349edf1793036c55a9ad5a393f34c940b553..e4e92971743dcf32fdef9f4c6753db642821c787 100644 (file)
@@ -72,11 +72,11 @@ module ApplicationHelper
     subject = nil
     text = options[:tracker] == false ? "##{issue.id}" : "#{issue.tracker} ##{issue.id}"
     if options[:subject] == false
-      title = truncate(issue.subject, :length => 60)
+      title = issue.subject.truncate(60)
     else
       subject = issue.subject
-      if options[:truncate]
-        subject = truncate(subject, :length => options[:truncate])
+      if truncate_length = options[:truncate]
+        subject = subject.truncate(truncate_length)
       end
     end
     only_path = options[:only_path].nil? ? true : options[:only_path]