Minor refactoring of ProjectsAPI

Remove unnecessary ivars, absolute namespacing.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/1634/head
Alex Coles 10 years ago
parent c5e97921cf
commit 6a64927d57
  1. 5
      lib/api/v3/projects/projects_api.rb

@ -39,13 +39,12 @@ module API
namespace ':id' do namespace ':id' do
before do before do
@project = Project.find(params[:id]) @project = Project.find(params[:id])
model = ::API::V3::Projects::ProjectModel.new(@project) @model = ProjectModel.new(@project)
@representer = ::API::V3::Projects::ProjectRepresenter.new(model)
end end
get do get do
authorize(:view_project, context: @project) authorize(:view_project, context: @project)
@representer ProjectRepresenter.new(@model)
end end
mount API::V3::Versions::VersionsAPI mount API::V3::Versions::VersionsAPI

Loading…
Cancel
Save