Add schedule model

This commit is contained in:
Petko Bordjukov 2014-10-12 13:26:07 +03:00
parent a716eae7e8
commit f34b03d64b
4 changed files with 29 additions and 0 deletions

3
app/models/hall.rb Normal file
View File

@ -0,0 +1,3 @@
class Hall < ActiveRecord::Base
belongs_to :conference
end

4
app/models/slot.rb Normal file
View File

@ -0,0 +1,4 @@
class Slot < ActiveRecord::Base
belongs_to :hall
belongs_to :event
end

View File

@ -0,0 +1,10 @@
class CreateHalls < ActiveRecord::Migration
def change
create_table :halls do |t|
t.references :conference, index: true
t.string :name
t.timestamps
end
end
end

View File

@ -0,0 +1,12 @@
class CreateSlots < ActiveRecord::Migration
def change
create_table :slots do |t|
t.references :hall, index: true
t.timestamp :starts_at, null: false
t.timestamp :ends_at, null: false
t.references :event, index: true
t.timestamps
end
end
end