#510 new
shawn (at vegantech)

Principals bug in student.rb, Gets all grade specific principals in district

Reported by shawn (at vegantech) | September 30th, 2010 @ 02:00 PM | in Evaluate to see if applicable.

I should also refactor all_students_in_school as it doesn't really need an argument for the school.

Note in the code here, the second principals << line (156) does not filter by the specific school at all.

148 def special_group_principals
149 grades = enrollments.collect(&:grade)
150 schools = enrollments.collect(&:school_id)
151 principals = []
152
153 principals << district.special_user_groups.principal.all_students_in_district.collect(&:user)
154 schools.each do |school|
155 principals << district.special_user_groups.principal.all_students_in_school(school).collect(&:user)
156 principals << district.special_user_groups.principal.find_all_by_grouptype_and_grade(SpecialUserGroup::ALL_STUDENTS_IN_SCHOOL, grades).collect(&:user)
157 end
158
159 principals
160 end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Student Intervention Monitoring System

Shared Ticket Bins

People watching this ticket

Referenced by

Pages