Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
628bf9e6
Commit
628bf9e6
authored
Sep 10, 2018
by
Zac Wood
Browse files
Created Instructor model
parent
2b2f88de
Changes
6
Hide whitespace changes
Inline
Side-by-side
schedules_api/app/models/instructor.rb
0 → 100644
View file @
628bf9e6
class
Instructor
<
ApplicationRecord
end
schedules_api/db/migrate/20180910210705_create_instructors.rb
0 → 100644
View file @
628bf9e6
class
CreateInstructors
<
ActiveRecord
::
Migration
[
5.1
]
def
change
create_table
:instructors
do
|
t
|
t
.
string
:name
t
.
timestamps
end
end
end
schedules_api/db/migrate/20180910210737_add_instructor_key_to_course_sections.rb
0 → 100644
View file @
628bf9e6
class
AddInstructorKeyToCourseSections
<
ActiveRecord
::
Migration
[
5.1
]
def
up
remove_column
:course_sections
,
:instructor
add_reference
:course_sections
,
:instructor
,
foreign_key:
true
end
def
down
remove_reference
:course_sections
,
:instructor
add_column
:course_sections
,
:instructor
,
:string
end
end
schedules_api/db/schema.rb
View file @
628bf9e6
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180
619011649
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180
910210737
)
do
create_table
"closures"
,
force: :cascade
do
|
t
|
t
.
date
"date"
...
...
@@ -25,7 +25,6 @@ ActiveRecord::Schema.define(version: 20180619011649) do
t
.
string
"crn"
t
.
string
"section_type"
t
.
string
"title"
t
.
string
"instructor"
t
.
date
"start_date"
t
.
date
"end_date"
t
.
string
"days"
...
...
@@ -39,7 +38,9 @@ ActiveRecord::Schema.define(version: 20180619011649) do
t
.
integer
"course_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"instructor_id"
t
.
index
[
"course_id"
],
name:
"index_course_sections_on_course_id"
t
.
index
[
"instructor_id"
],
name:
"index_course_sections_on_instructor_id"
end
create_table
"courses"
,
force: :cascade
do
|
t
|
...
...
@@ -51,6 +52,12 @@ ActiveRecord::Schema.define(version: 20180619011649) do
t
.
index
[
"semester_id"
],
name:
"index_courses_on_semester_id"
end
create_table
"instructors"
,
force: :cascade
do
|
t
|
t
.
string
"name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
create_table
"semesters"
,
force: :cascade
do
|
t
|
t
.
string
"season"
t
.
string
"year"
...
...
schedules_api/test/fixtures/instructors.yml
0 → 100644
View file @
628bf9e6
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one
:
name
:
MyString
two
:
name
:
MyString
schedules_api/test/models/instructor_test.rb
0 → 100644
View file @
628bf9e6
require
'test_helper'
class
InstructorTest
<
ActiveSupport
::
TestCase
# test "the truth" do
# assert true
# end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment