#780: add sha1 field into build_list_packages table, update models, views

This commit is contained in:
Vokhmin Alexey V 2013-01-10 15:16:08 +04:00
parent 140d5a036a
commit c521e5d77e
4 changed files with 10 additions and 9 deletions

View File

@ -11,6 +11,7 @@ class BuildList::Package < ActiveRecord::Base
:package_type, :name, :release, :version,
:presence => true
validates :package_type, :inclusion => PACKAGE_TYPES
validates :sha1, :presence => true, :if => Proc.new { |p| p.build_list.new_core? }
default_scope order('lower(name) ASC, length(name) ASC')

View File

@ -167,7 +167,10 @@
%tbody
- @build_list.packages.each do |package|
%tr
%td= package.fullname
- if package.sha1.present?
%td= link_to package.fullname, "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{package.sha1}"
- else
%td= package.fullname
%td= package.name
%td= package.version
%td= package.release

View File

@ -0,0 +1,5 @@
class AbbSha1ToBuildListPackage < ActiveRecord::Migration
def change
add_column :build_list_packages, :sha1, :string
end
end

View File

@ -46,14 +46,6 @@ module AbfWorker
package.platform_id = bl.save_to_platform_id
package.save!
end
container = (options['results'] || []).
select{ |r| r['file_name'] !~ /.*\.log$/ }.first
sha1 = container ? container['sha1'] : nil
if sha1
bl.container_path = "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{sha1}"
bl.save!
end
update_results(bl, options)
end
end