[#369] truncate activity commit messages

This commit is contained in:
Alexander Machehin 2014-04-08 18:56:22 +06:00
parent 7644a0f4cc
commit 54ce497e61
1 changed files with 2 additions and 2 deletions

View File

@ -17,11 +17,11 @@ module Feed::Git
change_type: change_type, project_owner: record.project.owner.uname}
else
if record.message # online update
last_commits, commits = [[record.newrev, record.message]], []
last_commits, commits = [[record.newrev, truncate(record.message, 50, omission: '…')]], []
all_commits = last_commits
else
commits = record.project.repo.commits_between(record.oldrev, record.newrev)
all_commits = commits.collect { |commit| [commit.sha, commit.message] }
all_commits = commits.collect { |commit| [commit.sha, truncate(commit.message, 50, omission: '…')] }
last_commits = all_commits.last(3).reverse
end