Created
April 8, 2020 21:17
-
-
Save rpdecks/829b1cf6795a19bf7d69db7b23ddea54 to your computer and use it in GitHub Desktop.
BoatingTest.pass_student
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pass_student(student, test) | |
found_test = BoatingTest.all.find { |bt| bt.test_name == test && bt.student == student} | |
binding.pry | |
if found_test && found_test.test_status != "pass" | |
found_test.test_status = "pass" | |
elsif !found_test | |
found_test = BoatingTest.new(student, test, "pass", self) | |
end | |
found_test | |
end |
Spent a bit of time on this one w the brothers last night. Went thru w my coach today. Sharing what we ended up w. Of course can refactor... but cool anyhow
This is just a snip of a method inside a many to many thru class lab
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
huh?