[refs #374] Small refactoring
This commit is contained in:
parent
a20e1552cc
commit
7c4c855341
|
@ -31,7 +31,7 @@ json.build_list do |json|
|
||||||
|
|
||||||
json.owner do |json_owner|
|
json.owner do |json_owner|
|
||||||
json_owner.(@build_list.user, :id, :name)
|
json_owner.(@build_list.user, :id, :name)
|
||||||
json_owner.url @build_list.project.owner_type == 'User' ? user_path(@build_list.project.owner.uname) : group_path(@build_list.project.owner.uname)
|
json_owner.url url_for(@build_list.project.owner)
|
||||||
end
|
end
|
||||||
|
|
||||||
inc_repos = Repository.includes(:platform).where(:id => @build_list.include_repos)
|
inc_repos = Repository.includes(:platform).where(:id => @build_list.include_repos)
|
||||||
|
|
|
@ -3,7 +3,7 @@ json.platforms @platforms do |json, platform|
|
||||||
json.owner do |json_owner|
|
json.owner do |json_owner|
|
||||||
json_owner.(platform.owner, :id, :name)
|
json_owner.(platform.owner, :id, :name)
|
||||||
json_owner.type platform.owner_type
|
json_owner.type platform.owner_type
|
||||||
json_owner.url platform.owner_type == 'User' ? user_path(platform.owner) : group_path(platform.owner)
|
json_owner.url url_for(platform.owner)
|
||||||
end
|
end
|
||||||
json.repositories do |json_rep|
|
json.repositories do |json_rep|
|
||||||
platform.repositories.each do |repo|
|
platform.repositories.each do |repo|
|
||||||
|
|
|
@ -5,7 +5,7 @@ json.platform do |json|
|
||||||
json.owner do |json_owner|
|
json.owner do |json_owner|
|
||||||
json_owner.(@platform.owner, :id, :name)
|
json_owner.(@platform.owner, :id, :name)
|
||||||
json_owner.type @platform.owner_type
|
json_owner.type @platform.owner_type
|
||||||
json_owner.url @platform.owner_type == 'User' ? user_path(@platform.owner) : group_path(@platform.owner)
|
json_owner.url url_for(@platform.owner)
|
||||||
end
|
end
|
||||||
json.repositories do |json_rep|
|
json.repositories do |json_rep|
|
||||||
@platform.repositories.each do |repo|
|
@platform.repositories.each do |repo|
|
||||||
|
|
|
@ -3,7 +3,7 @@ json.project do |json|
|
||||||
json.owner do |json_owner|
|
json.owner do |json_owner|
|
||||||
json_owner.(@project.owner, :id, :name)
|
json_owner.(@project.owner, :id, :name)
|
||||||
json_owner.type @project.owner_type
|
json_owner.type @project.owner_type
|
||||||
json_owner.url @project.owner_type == 'User' ? user_path(@project.owner) : group_path(@project.owner)
|
json_owner.url url_for(@project.owner)
|
||||||
end
|
end
|
||||||
json.url api_v1_project_path(@project, :format => :json)
|
json.url api_v1_project_path(@project, :format => :json)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ json.projects @projects do |json, project|
|
||||||
json.owner do |json_owner|
|
json.owner do |json_owner|
|
||||||
json_owner.(project.owner, :id, :name)
|
json_owner.(project.owner, :id, :name)
|
||||||
json_owner.type project.owner_type
|
json_owner.type project.owner_type
|
||||||
json_owner.url project.owner_type == 'User' ? user_path(project.owner) : group_path(project.owner)
|
json_owner.url url_for(project.owner)
|
||||||
end
|
end
|
||||||
json.url api_v1_project_path(project, :format => :json)
|
json.url api_v1_project_path(project, :format => :json)
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ json.project do |json|
|
||||||
json.owner do |json_owner|
|
json.owner do |json_owner|
|
||||||
json_owner.(@project.owner, :id, :name)
|
json_owner.(@project.owner, :id, :name)
|
||||||
json_owner.type @project.owner_type
|
json_owner.type @project.owner_type
|
||||||
json_owner.url @project.owner_type == 'User' ? user_path(@project.owner) : group_path(@project.owner)
|
json_owner.url url_for(@project.owner)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ require File.expand_path('../boot', __FILE__)
|
||||||
|
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
require 'rack/throttle'
|
require 'rack/throttle'
|
||||||
|
require 'redis'
|
||||||
|
|
||||||
# If you have a Gemfile, require the gems listed there, including any gems
|
# If you have a Gemfile, require the gems listed there, including any gems
|
||||||
# you've limited to :test, :development, or :production.
|
# you've limited to :test, :development, or :production.
|
||||||
|
|
Loading…
Reference in New Issue