#82: sort of mass builds on monitoring page by created date

This commit is contained in:
Vokhmin Alexey V 2013-05-17 15:42:01 +04:00
parent 6aede76ef2
commit fc9ef8e0af
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