From 388b606f220733310a5d743d351428f85768f7b2 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 22 Jan 2013 19:39:56 +0400 Subject: [PATCH] #836: add packages into build_list, add url to package --- app/views/api/v1/build_lists/show.json.jbuilder | 4 ++++ app/views/api/v1/maintainers/_package.json.jbuilder | 1 + 2 files changed, 5 insertions(+) diff --git a/app/views/api/v1/build_lists/show.json.jbuilder b/app/views/api/v1/build_lists/show.json.jbuilder index 1f07e603a..2ed6ad47c 100644 --- a/app/views/api/v1/build_lists/show.json.jbuilder +++ b/app/views/api/v1/build_lists/show.json.jbuilder @@ -64,5 +64,9 @@ json.build_list do |json| json_logs.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}" 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) end diff --git a/app/views/api/v1/maintainers/_package.json.jbuilder b/app/views/api/v1/maintainers/_package.json.jbuilder index a6d452013..c4f92edc3 100644 --- a/app/views/api/v1/maintainers/_package.json.jbuilder +++ b/app/views/api/v1/maintainers/_package.json.jbuilder @@ -1,3 +1,4 @@ json.(package, :id, :name, :version, :release) json.type package.package_type json.updated_at package.updated_at.to_i +json.url (package.sha1 ? "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{package.sha1}" : '' ) \ No newline at end of file