mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
chore: prevent multiple lookups for the boston district by inlining the
sql
This commit is contained in:
parent
db7c74479d
commit
9e368ae47d
1 changed files with 1 additions and 2 deletions
|
|
@ -16,8 +16,7 @@ class SurveyItemResponse < ActiveRecord::Base
|
|||
has_one :measure, through: :survey_item
|
||||
|
||||
scope :exclude_boston, lambda {
|
||||
boston = District.find_by_name("Boston")
|
||||
where.not(school: boston.schools) if boston.present?
|
||||
includes(school: :district).where.not("district.name": "Boston")
|
||||
}
|
||||
|
||||
scope :averages_for_grade, lambda { |survey_items, school, academic_year, grade|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue