Commit 8c8892460678471db1fce5129a0c2c7dd18f3b38
1 parent
bcf55312
Exists in
master
and in
4 other branches
fix #132
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
app/helpers/commits_helper.rb
... | ... | @@ -22,10 +22,12 @@ module CommitsHelper |
22 | 22 | :remote => true, :class => "lite_button vm", :style => "text-align:center; width:930px; ", :id => "more-commits-link" |
23 | 23 | end |
24 | 24 | |
25 | + # Cause some errors with trucate & encoding use this method | |
25 | 26 | def truncate_commit_message(commit, size = 60) |
26 | - truncate(commit.message, :length => size) | |
27 | + message = commit.message | |
28 | + message.length > size ? (message[0..(size - 1)] + "...") : message | |
27 | 29 | # if special characters occurs |
28 | 30 | rescue |
29 | - commit.message.length > size ? (commit.message[0..(size - 1)] + "...") : commit.message | |
31 | + commit.message | |
30 | 32 | end |
31 | 33 | end | ... | ... |