diff options
author | Peter Wilmott <p@p8952.info> | 2015-03-22 21:48:43 +0000 |
---|---|---|
committer | Peter Wilmott <p@p8952.info> | 2015-03-22 21:48:43 +0000 |
commit | a724ee5141bd161cd768dc2d5e8d8f11b29fd09d (patch) | |
tree | a0610ca53b3d71646c6a0baafc18d82ea7fa6aad /web | |
parent | Add new_targets page (diff) | |
download | ruby-tinderbox-a724ee5141bd161cd768dc2d5e8d8f11b29fd09d.tar.gz ruby-tinderbox-a724ee5141bd161cd768dc2d5e8d8f11b29fd09d.tar.bz2 ruby-tinderbox-a724ee5141bd161cd768dc2d5e8d8f11b29fd09d.zip |
Exit early if one factor is nil, force the ordering of packages
Diffstat (limited to 'web')
-rw-r--r-- | web/app.rb | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -85,17 +85,19 @@ class RubyTinderbox < Sinatra::Base packages = [] Package.each do |package| build_current = package.build_dataset.where(target: 'current').reverse_order(:timestamp).first - repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first - repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first - next if build_current.nil? + + repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first next if repoman_current.nil? + + repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first next if repoman_next.nil? if repoman_current[:result] == 'passed' and repoman_next[:result] == 'passed' packages << [package, build_current, nil, repoman_current, repoman_next] end end + packages = packages.compact.sort_by { |package| package[0][:identifier] } erb :'bumps/new_targets', locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } end |