Update BuildListItems for new requirement

This commit is contained in:
Vladimir Sharshov 2011-10-29 18:05:40 +04:00
parent 6b993db2fc
commit 8c7b196764
4 changed files with 13 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class BuildList < ActiveRecord::Base
items_hash.each do |level, items|
items.each do |item|
self.items << self.items.build(:name => item, :level => level.to_i)
self.items << self.items.build(:name => item['name'], :version => item['version'], :level => level.to_i)
end
end
end

View File

@ -95,11 +95,13 @@
%table.table
%tr
%th.first= t("activerecord.attributes.build_list/item.name")
%th= t("activerecord.attributes.build_list/item.version")
%th.last= t("activerecord.attributes.build_list/item.status")
- group.each do |item|
%tr{:class => cycle("odd", "even")}
%td= item.name
%td= item.version
%td.last= item.human_status
- content_for :sidebar, render(:partial => 'sidebar')

View File

@ -477,6 +477,7 @@ ru:
name: Название
level: Уровень
status: Статус
version: Версия
build_list: Сборочный лист
download:
name: Название

View File

@ -0,0 +1,9 @@
class AddVersionToBuildListItems < ActiveRecord::Migration
def self.up
add_column :build_list_items, :version, :string
end
def self.down
remove_column :build_list_items, :version
end
end