From 54ce497e61a05dfc11eb8cd78edf4d9c5309c16c Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 8 Apr 2014 18:56:22 +0600 Subject: [PATCH] [#369] truncate activity commit messages --- app/models/concerns/feed/git.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/feed/git.rb b/app/models/concerns/feed/git.rb index de5ab8ffa..fce35a79f 100644 --- a/app/models/concerns/feed/git.rb +++ b/app/models/concerns/feed/git.rb @@ -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