From: gitlabhq Date: Sun, 16 Oct 2011 22:14:48 +0000 (+0300) Subject: fix #132 X-Git-Tag: v1.2.0pre~126 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8c8892460678471db1fce5129a0c2c7dd18f3b38;p=wvm%2Fgitlab.git fix #132 --- diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 4e7de84fc..b79e57181 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -22,10 +22,12 @@ module CommitsHelper :remote => true, :class => "lite_button vm", :style => "text-align:center; width:930px; ", :id => "more-commits-link" end + # Cause some errors with trucate & encoding use this method def truncate_commit_message(commit, size = 60) - truncate(commit.message, :length => size) + message = commit.message + message.length > size ? (message[0..(size - 1)] + "...") : message # if special characters occurs rescue - commit.message.length > size ? (commit.message[0..(size - 1)] + "...") : commit.message + commit.message end end