Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Corrected bug where an invalid CourseType would cause the Report Card…

… report to fail
  • Loading branch information...
commit 800545af39b869d947922897f8a1f4adf75317fd 1 parent 6fee227
Richard Hurt authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  app/views/courses/edit.html.erb
  2. +1 −1  lib/reports/report_card.rb
2  app/views/courses/edit.html.erb
View
@@ -15,11 +15,11 @@
<br />
<%= f.label :course_type_id, {}, :class => 'req' %>
<%= collection_select :course, :course_type_id, CourseType.active, :id, :name %>
- <% end %>
<div class="spacer">
<%= submit_tag 'Save', :class=> 'btn positive' %>
<%= link_to 'Cancel', courses_path, :class => 'btn standard' %>
+ <% end %>
<%= button_to 'Delete Course', @course,
:method => :delete, :class => "btn negative",
:confirm => "Are you sure you want to delete the '#{@course.name}' course?" %>
2  lib/reports/report_card.rb
View
@@ -156,7 +156,7 @@ def new_page
# Get the courses this student is enrolled in for the school year
@courses = student.courses.by_school_year(school_year)
# and sort them by course type (taking into account any NIL course types)
- @courses.sort! { |a,b| a.course_type.nil? || b.course_type.nil? ? 0 : a.course_type.position <=> b.course_type.position }
+ @courses.sort! { |a,b| a.course_type.position.blank? || b.course_type.position.blank? ? 0 : a.course_type.position <=> b.course_type.position }
# Build the page header
header margin_box.top_left do
Please sign in to comment.
Something went wrong with that request. Please try again.