-
-
Save tpope/762ef57d5fe526441094 to your computer and use it in GitHub Desktop.
A way to fing the first thing that matches or set to nil
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
grading_period = @context.courses.detect do |course| | |
gp = GradingPeriod.context_find(course, params[:grading_period_id]) and break gp | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment