diff --git a/app/models/lecture.rb b/app/models/lecture.rb new file mode 100644 index 0000000..451c38b --- /dev/null +++ b/app/models/lecture.rb @@ -0,0 +1,9 @@ +class Lecture < ApplicationRecord + enum :status, [ + :future, + :live, + :attended, + :watched, + :missed, + ] +end diff --git a/db/migrate/20230929171214_create_lectures.rb b/db/migrate/20230929171214_create_lectures.rb new file mode 100644 index 0000000..d5c6ecb --- /dev/null +++ b/db/migrate/20230929171214_create_lectures.rb @@ -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 diff --git a/test/fixtures/lectures.yml b/test/fixtures/lectures.yml new file mode 100644 index 0000000..c7f42e4 --- /dev/null +++ b/test/fixtures/lectures.yml @@ -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 diff --git a/test/models/lecture_test.rb b/test/models/lecture_test.rb new file mode 100644 index 0000000..d4080b2 --- /dev/null +++ b/test/models/lecture_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class LectureTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end