remove Tree/Commit decorator usage from controllers

master
Dmitriy Zaporozhets 2013-03-31 23:46:25 +03:00
parent 2a6b4f965e
commit 685681e28a
4 changed files with 0 additions and 10 deletions

View File

@ -13,8 +13,6 @@ class CommitsController < ProjectResourceController
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @repo.commits(@ref, @path, @limit, @offset)
@commits = Commit.decorate(@commits)
@commits = CommitDecorator.decorate_collection(@commits)
respond_to do |format|
format.html # index.html.erb

View File

@ -15,8 +15,6 @@ class CompareController < ProjectResourceController
@diffs = result[:diffs]
@refs_are_same = result[:same]
@line_notes = []
@commits = CommitDecorator.decorate_collection(@commits)
end
def create

View File

@ -94,12 +94,10 @@ class MergeRequestsController < ProjectResourceController
def branch_from
@commit = @repository.commit(params[:ref])
@commit = CommitDecorator.decorate(@commit)
end
def branch_to
@commit = @repository.commit(params[:ref])
@commit = CommitDecorator.decorate(@commit)
end
def ci_status
@ -143,7 +141,6 @@ class MergeRequestsController < ProjectResourceController
# Get commits from repository
# or from cache if already merged
@commits = @merge_request.commits
@commits = CommitDecorator.decorate_collection(@commits)
@allowed_to_merge = allowed_to_merge?
@show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge

View File

@ -34,7 +34,6 @@ class RefsController < ProjectResourceController
@logs = contents.map do |content|
file = params[:path] ? File.join(params[:path], content.name) : content.name
last_commit = @repo.commits(@commit.id, file, 1).last
last_commit = CommitDecorator.decorate(last_commit)
{
file_name: content.name,
commit: last_commit
@ -49,9 +48,7 @@ class RefsController < ProjectResourceController
@repo = project.repository
@commit = @repo.commit(@ref)
@commit = CommitDecorator.decorate(@commit)
@tree = Tree.new(@commit.tree, @ref, params[:path])
@tree = TreeDecorator.new(@tree)
@hex_path = Digest::SHA1.hexdigest(params[:path] || "")
if params[:path]