removes basicprojectwithaccess and replaces it with basicprojectdetails

This commit is contained in:
tiagonbotelho 2016-07-12 17:32:40 +01:00
parent b4a919ab9e
commit 563b303bde
3 changed files with 1 additions and 9 deletions

BIN
lib/api/.projects.rb.swn Normal file

Binary file not shown.

View File

@ -342,14 +342,6 @@ module API
end
end
class BasicProjectWithAccess < BasicProjectDetails
expose :permissions do
expose :project_access, using: Entities::ProjectAccess do |project, options|
project.project_members.find_by(user_id: options[:user].id)
end
end
end
class ProjectWithAccess < Project
expose :permissions do
expose :project_access, using: Entities::ProjectAccess do |project, options|

View File

@ -26,7 +26,7 @@ module API
@projects = filter_projects(@projects)
@projects = paginate @projects
if params[:simple]
present @projects, with: Entities::BasicProjectWithAccess, user: current_user
present @projects, with: Entities::BasicProjectDetails, user: current_user
else
present @projects, with: Entities::ProjectWithAccess, user: current_user
end