Create lecture model

This commit is contained in:
Joshua Coles 2023-09-29 18:14:31 +01:00
parent 86b8846f20
commit a496965d81
4 changed files with 41 additions and 0 deletions

9
app/models/lecture.rb Normal file
View File

@ -0,0 +1,9 @@
class Lecture < ApplicationRecord
enum :status, [
:future,
:live,
:attended,
:watched,
:missed,
]
end

View File

@ -0,0 +1,12 @@
class CreateLectures < ActiveRecord::Migration[7.0]
def change
create_table :lectures do |t|
t.string :title, null: false
t.datetime :start_time, null: false
t.integer :status, null: false
t.string :recording_id, null: false
t.timestamps
end
end
end

13
test/fixtures/lectures.yml vendored Normal file
View File

@ -0,0 +1,13 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
title: MyString
start_time: 2023-09-29 18:12:14
status: 1
recording_id: MyString
two:
title: MyString
start_time: 2023-09-29 18:12:14
status: 1
recording_id: MyString

View File

@ -0,0 +1,7 @@
require "test_helper"
class LectureTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end