[Refs #223] Small refactoring for pull request
This commit is contained in:
parent
742603ab7e
commit
36447051ec
|
@ -59,10 +59,7 @@ class BuildList < ActiveRecord::Base
|
|||
}
|
||||
|
||||
scope :recent, order("#{table_name}.updated_at DESC")
|
||||
# scope :current, lambda {
|
||||
# outdatable_statuses = [BuildServer::SUCCESS, BuildServer::ERROR, BuildServer::PLATFORM_NOT_FOUND, BuildServer::PLATFORM_PENDING, BuildServer::PROJECT_NOT_FOUND, BuildServer::PROJECT_VERSION_NOT_FOUND]
|
||||
# where(["status in (?) OR (status in (?) AND notified_at >= ?)", [WAITING_FOR_RESPONSE, BUILD_PENDING, BuildServer::BUILD_STARTED], outdatable_statuses, Time.now - 2.days])
|
||||
# }
|
||||
|
||||
scope :for_status, lambda {|status| where(:status => status) }
|
||||
scope :for_user, lambda { |user| where(:user_id => user.id) }
|
||||
scope :scoped_to_arch, lambda {|arch| where(:arch_id => arch) }
|
||||
|
@ -140,7 +137,7 @@ class BuildList < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def human_duration
|
||||
I18n.t("layout.build_lists.human_duration", {:minutes => (duration/60).to_i, :seconds => (duration%60).to_i})
|
||||
I18n.t("layout.build_lists.human_duration", {:hours => (duration/360).to_i, :minutes => (duration/60).to_i})
|
||||
end
|
||||
|
||||
def finished?
|
||||
|
|
|
@ -61,7 +61,7 @@ en:
|
|||
action: Action
|
||||
new_header: New build
|
||||
main_data: Main data
|
||||
human_duration: Build lasted %{minutes} minutes %{seconds} seconds
|
||||
human_duration: Builded in %{hours} h. %{minutes} min.
|
||||
|
||||
ownership:
|
||||
header: Build list ownership
|
||||
|
|
|
@ -60,7 +60,7 @@ ru:
|
|||
action: Действие
|
||||
new_header: Новая сборка
|
||||
main_data: Основные данные
|
||||
human_duration: Сборка продлилась %{minutes} минут %{seconds} секунд
|
||||
human_duration: Собрано за %{hours} ч. %{minutes} мин.
|
||||
|
||||
ownership:
|
||||
header: Принадлежность заданий
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
class AddStartedAtAndFinishedAtToBuildLists < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :build_lists, :started_at, :datetime
|
||||
add_column :build_lists, :finished_at, :datetime
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
class RemoveUnusedFields < ActiveRecord::Migration
|
||||
def up
|
||||
remove_column :build_lists, :started_at
|
||||
remove_column :build_lists, :finished_at
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue