Skip to content

Instantly share code, notes, and snippets.

@rpdecks
Created April 8, 2020 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpdecks/829b1cf6795a19bf7d69db7b23ddea54 to your computer and use it in GitHub Desktop.
Save rpdecks/829b1cf6795a19bf7d69db7b23ddea54 to your computer and use it in GitHub Desktop.
BoatingTest.pass_student
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
@pdbradley
Copy link

huh?

@rpdecks
Copy link
Author

rpdecks commented Apr 8, 2020

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

@rpdecks
Copy link
Author

rpdecks commented Apr 8, 2020

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