Skip to content

Instantly share code, notes, and snippets.

@johana-star
Created September 14, 2015 23:23
Show Gist options
  • Save johana-star/beca99f3e868d8a17e14 to your computer and use it in GitHub Desktop.
Save johana-star/beca99f3e868d8a17e14 to your computer and use it in GitHub Desktop.
A way to fing the first thing that matches or set to nil
grading_period = nil
@context.courses.each do |course|
break if grading_period = GradingPeriod.context_find(course, params[:grading_period_id])
end
@tpitale
Copy link

tpitale commented Sep 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment