Merge pull request #1127 from riyad/use-decorators

Use CommitDecorator more
This commit is contained in:
Dmitriy Zaporozhets 2012-07-25 11:25:55 -07:00
commit 5133541f25
13 changed files with 37 additions and 24 deletions

View file

@ -17,6 +17,7 @@ class CommitsController < ApplicationController
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @project.commits(@ref, params[:path], @limit, @offset)
@commits = CommitDecorator.decorate(@commits)
respond_to do |format|
format.html # index.html.erb

View file

@ -143,5 +143,6 @@ class MergeRequestsController < ApplicationController
# Get commits from repository
# or from cache if already merged
@commits = @merge_request.commits
@commits = CommitDecorator.decorate(@commits)
end
end

View file

@ -51,7 +51,8 @@ class RefsController < ApplicationController
@logs = contents.map do |content|
file = params[:path] ? File.join(params[:path], content.name) : content.name
last_commit = @project.commits(@commit.id, file, 1).last
{
last_commit = CommitDecorator.decorate(last_commit)
{
:file_name => content.name,
:commit => last_commit
}