From d431e4339269041784986da40a0e0879baaf96a9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 2 Jan 2013 19:32:34 +0200 Subject: Fix few bugs and tests after refactoring ownership logic --- lib/api/projects.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/projects.rb') diff --git a/lib/api/projects.rb b/lib/api/projects.rb index fb01524da39..c71fd64838b 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -9,7 +9,7 @@ module Gitlab # Example Request: # GET /projects get do - @projects = paginate current_user.projects + @projects = paginate current_user.authorized_projects present @projects, with: Entities::Project end -- cgit v1.2.1 From afbdbb0c959affbdb8725eafb8169025a8aede1e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 4 Jan 2013 18:50:31 +0200 Subject: Rspec fixes --- lib/api/projects.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/api/projects.rb') diff --git a/lib/api/projects.rb b/lib/api/projects.rb index c71fd64838b..55c81f3158a 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -257,7 +257,7 @@ module Gitlab per_page = params[:per_page] || 20 ref = params[:ref_name] || user_project.try(:default_branch) || 'master' - commits = user_project.commits(ref, nil, per_page, page * per_page) + commits = user_project.repository.commits(ref, nil, per_page, page * per_page) present CommitDecorator.decorate(commits), with: Entities::RepoCommit end @@ -375,10 +375,10 @@ module Gitlab ref = params[:sha] - commit = user_project.commit ref + commit = user_project.repository.commit ref not_found! "Commit" unless commit - tree = Tree.new commit.tree, user_project, ref, params[:filepath] + tree = Tree.new commit.tree, ref, params[:filepath] not_found! "File" unless tree.try(:tree) content_type tree.mime_type -- cgit v1.2.1