Skip to content

Instantly share code, notes, and snippets.

@tpope
Created September 14, 2015 23:37
Show Gist options
  • Select an option

  • Save tpope/15c9486b439238402bb3 to your computer and use it in GitHub Desktop.

Select an option

Save tpope/15c9486b439238402bb3 to your computer and use it in GitHub Desktop.

Revisions

  1. tpope created this gist Sep 14, 2015.
    3 changes: 3 additions & 0 deletions find_first_or_nil.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    grading_period = @context.courses.map do |course|
    GradingPeriod.context_find(course, params[:grading_period_id])
    end.compact.first