mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
import students
This commit is contained in:
parent
8c7767d0b9
commit
12e4e3f177
28 changed files with 11093 additions and 10843 deletions
|
|
@ -183,10 +183,11 @@ class Measure < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def sufficient_student_data?(school:, academic_year:)
|
||||
return @sufficient_student_data ||= false unless includes_student_survey_items?
|
||||
return @sufficient_student_data ||= false if no_student_responses_exist?(school:, academic_year:)
|
||||
false unless includes_student_survey_items?
|
||||
false if no_student_responses_exist?(school:, academic_year:)
|
||||
|
||||
@sufficient_student_data ||= subcategory.response_rate(school:, academic_year:).meets_student_threshold?
|
||||
# this gets memoized on first run so check to make sure
|
||||
subcategory.response_rate(school:, academic_year:).meets_student_threshold?
|
||||
end
|
||||
|
||||
def sufficient_teacher_data?(school:, academic_year:)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
class Race < ApplicationRecord
|
||||
include FriendlyId
|
||||
has_many :student_races
|
||||
has_many :students, through: :student_races
|
||||
friendly_id :designation, use: [:slugged]
|
||||
end
|
||||
|
|
|
|||
7
app/models/student.rb
Normal file
7
app/models/student.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
class Student < ApplicationRecord
|
||||
has_many :survey_item_responses
|
||||
has_many :student_races
|
||||
has_many :races, through: :student_races
|
||||
|
||||
encrypts :lasid, deterministic: true
|
||||
end
|
||||
4
app/models/student_race.rb
Normal file
4
app/models/student_race.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class StudentRace < ApplicationRecord
|
||||
belongs_to :student
|
||||
belongs_to :race
|
||||
end
|
||||
|
|
@ -7,6 +7,8 @@ class SurveyItemResponse < ActiveRecord::Base
|
|||
belongs_to :academic_year
|
||||
belongs_to :school
|
||||
belongs_to :survey_item, counter_cache: true
|
||||
belongs_to :student, foreign_key: :student_id, optional: true
|
||||
|
||||
has_one :measure, through: :survey_item
|
||||
|
||||
scope :exclude_boston, lambda {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue