Merge pull request #139 from abf/rosa-build:82-sort-of-mass-builds-on-monitoring-page

[refs #82]: sort mass build in monitoring page by created date (fresh in top).
This commit is contained in:
warpc 2013-05-17 18:10:31 +04:00
commit e806db5428
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ class MassBuild < ActiveRecord::Base
belongs_to :user
has_many :build_lists, :dependent => :destroy
scope :recent, order("#{table_name}.created_at DESC")
scope :by_platform, lambda { |platform| where(:platform_id => platform.id) }
scope :outdated, where("#{table_name}.created_at < ?", Time.now + 1.day - BuildList::MAX_LIVE_TIME)

View File

@ -38,7 +38,7 @@
= f.select :arch_id, Arch.recent.collect{|arch| [arch.name, arch.id]}, {:include_blank => true, :selected => @filter.arch_id}, html_options.merge(:id => 'architecture')
%h3.medium= t 'activerecord.models.mass_build'
.lineForm.aside
= f.select :mass_build_id, options_from_collection_for_select( MassBuild.all, :id, :name, @filter.mass_build_id ), {:include_blank => true, :selected => @filter.mass_build_id},
= f.select :mass_build_id, options_from_collection_for_select( MassBuild.recent, :id, :name, @filter.mass_build_id ), {:include_blank => true, :selected => @filter.mass_build_id},
html_options.merge(:id => 'mass_build')
.column