fix decorate calls on collections after draper update

This commit is contained in:
Dmitriy Zaporozhets 2013-03-01 15:24:59 +02:00
parent 520f02259c
commit 6aead7991f
6 changed files with 15 additions and 14 deletions

View file

@ -1,7 +1,7 @@
class Admin::Teams::MembersController < Admin::Teams::ApplicationController class Admin::Teams::MembersController < Admin::Teams::ApplicationController
def new def new
@users = User.potential_team_members(user_team) @users = User.potential_team_members(user_team)
@users = UserDecorator.decorate @users @users = UserDecorator.decorate_collection @users
end end
def create def create

View file

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

View file

@ -16,7 +16,7 @@ class CompareController < ProjectResourceController
@refs_are_same = result[:same] @refs_are_same = result[:same]
@line_notes = [] @line_notes = []
@commits = CommitDecorator.decorate(@commits) @commits = CommitDecorator.decorate_collection(@commits)
end end
def create def create

View file

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

View file

@ -8,7 +8,7 @@ class Teams::MembersController < Teams::ApplicationController
def new def new
@users = User.potential_team_members(user_team) @users = User.potential_team_members(user_team)
@users = UserDecorator.decorate @users @users = UserDecorator.decorate_collection @users
end end
def create def create

View file

@ -1,4 +1,5 @@
class ApplicationDecorator < Draper::Base class ApplicationDecorator < Draper::Decorator
delegate_all
# Lazy Helpers # Lazy Helpers
# PRO: Call Rails helpers without the h. proxy # PRO: Call Rails helpers without the h. proxy
# ex: number_to_currency(model.price) # ex: number_to_currency(model.price)