Add schedule model
This commit is contained in:
parent
a716eae7e8
commit
f34b03d64b
3
app/models/hall.rb
Normal file
3
app/models/hall.rb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class Hall < ActiveRecord::Base
|
||||||
|
belongs_to :conference
|
||||||
|
end
|
4
app/models/slot.rb
Normal file
4
app/models/slot.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class Slot < ActiveRecord::Base
|
||||||
|
belongs_to :hall
|
||||||
|
belongs_to :event
|
||||||
|
end
|
10
db/migrate/20141012100900_create_halls.rb
Normal file
10
db/migrate/20141012100900_create_halls.rb
Normal 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
|
12
db/migrate/20141012101004_create_slots.rb
Normal file
12
db/migrate/20141012101004_create_slots.rb
Normal 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
|
Loading…
x
Reference in New Issue
Block a user