#836: add packages into build_list, add url to package

This commit is contained in:
Vokhmin Alexey V 2013-01-22 19:39:56 +04:00
parent f0928badc8
commit 388b606f22
2 changed files with 5 additions and 0 deletions

View File

@ -64,5 +64,9 @@ json.build_list do |json|
json_logs.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}" json_logs.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}"
end if @build_list.new_core? end if @build_list.new_core?
json.packages @build_list.packages do |json_packages, package|
json_packages.partial! 'api/v1/maintainers/package', :package => package, :json => json_packages
end
json.url api_v1_build_list_path(@build_list, :format => :json) json.url api_v1_build_list_path(@build_list, :format => :json)
end end

View File

@ -1,3 +1,4 @@
json.(package, :id, :name, :version, :release) json.(package, :id, :name, :version, :release)
json.type package.package_type json.type package.package_type
json.updated_at package.updated_at.to_i json.updated_at package.updated_at.to_i
json.url (package.sha1 ? "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{package.sha1}" : '' )