Special thanks to Melaine MacDonald for an amazing project
Welcome to Boating School! This project is meant to help out Bikini Bottom citizens
take their boating test to get a license! There are three models, Student
,
Instructor
, and BoatingTest
.
- An
Instructor
has manyBoatingTests
- A
Student
has manyBoatingTests
- A
BoatingTest
belongs to aStudent
and an Instructor
As a kind reminder, try drawing out the relationship before attempting to write code. This will help you think about which models should own what data and which models should ask for information from other models.
A Student
should initialize with a first_name
and last_name
Student.all
- Returns all of the student instances
Student.full_names
- Returns an array of all students' full names
Student#add_boating_test(instructor, test_name, test_status)
- Should initialize a new
BoatingTest
with aStudent
object, a boating test name (String
), a boating test status (String
), and anInstructor
object
- Should initialize a new
Student.find_student(full_name)
- Takes in a full name as a string and returns back that
Student
object
- Takes in a full name as a string and returns back that
A BoatingTest
should initialize with a Student
object, a boating test name
(String
), a boating test status (String
), and an Instructor
object
BoatingTest.all
- Returns an array of all boating test instances
An Instructor
should initialize with a name
as a string.
Instructor.all
- Returns an array of all instructor instances
Instructor#fail_student(student_name, test_name)
- Changes a test's status to being
failed
- Changes a test's status to being
Instructor#pass_student(student_name, test_name)
- Changes a test's status to being
passed
- Changes a test's status to being
Instructor#boating_tests
- Shows all boating tests that this instructor is conducting