Issue #149 fixed

This commit is contained in:
gitlabhq 2011-10-25 07:32:02 +03:00
parent 5baa5fad0a
commit afe98ae74a
7 changed files with 15 additions and 11 deletions

View file

@ -1,8 +1,10 @@
module CommitExt
# Cause of encoding rails truncate raise error
# this method is temporary decision
def truncated_message(size = 80)
message.length > size ? (message[0..(size - 1)] + "...") : message
def safe_message
message.encode("UTF-8",
:invalid => :replace,
:undef => :replace,
:universal_newline => true,
:replace => "")
rescue
"-- invalid encoding for commit message"
end