Container/Arch/Rpm
This commit is contained in:
parent
c1ff6dcc05
commit
002dc417b5
|
@ -0,0 +1,2 @@
|
|||
class ContainersController < ApplicationController
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
module ContainersHelper
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
class Arch < ActiveRecord::Base
|
||||
validate :name, :presence => true, :uniqueness => true
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class Container < ActiveRecord::Base
|
||||
validate :name, :presence => true
|
||||
validate :project_id, :presence => true
|
||||
validate :onwer_id, :presence => true
|
||||
|
||||
belongs_to :project
|
||||
belongs_to :owner, :class_name => 'User', :foreign_key => 'owner_id'
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class Rpm < ActiveRecord::Base
|
||||
validate :name, :presence => true
|
||||
validate :arch_id, :presence => true
|
||||
validate :project_id, :presence => true
|
||||
|
||||
belongs_to :arch
|
||||
belongs_to :project
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
class CreateContainers < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :containers do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :project_id, :null => false
|
||||
t.integer :owner_id, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :containers
|
||||
end
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
class CreateArches < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :arches do |t|
|
||||
t.string :name, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :arches, :name, :unique => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :arches
|
||||
end
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
class CreateRpms < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :rpms do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :arch_id, :null => false
|
||||
t.integer :project_id, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :rpms, :project_id
|
||||
add_index :rpms, [:project_id, :arch_id]
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :rpms
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ContainersController do
|
||||
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the ContainersHelper. For example:
|
||||
#
|
||||
# describe ContainersHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# helper.concat_strings("this","that").should == "this that"
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe ContainersHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Arch do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Containter do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Rpm do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue