mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
Rename DataAvailability to Summary
This commit is contained in:
parent
09963c3323
commit
0ed6cbe6b4
8 changed files with 74 additions and 22 deletions
|
|
@ -1,4 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DataAvailability < Struct.new(:id, :description, :available?)
|
||||
end
|
||||
4
app/models/summary.rb
Normal file
4
app/models/summary.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Summary < Struct.new(:id, :description, :available?)
|
||||
end
|
||||
|
|
@ -29,6 +29,6 @@ class SurveyItem < ActiveRecord::Base
|
|||
}
|
||||
|
||||
def description
|
||||
DataAvailability.new(survey_item_id, prompt, true)
|
||||
Summary.new(survey_item_id, prompt, true)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ class AdminDataPresenter < DataItemPresenter
|
|||
|
||||
def descriptions_and_availability
|
||||
@admin_data_items.map do |admin_data_item|
|
||||
DataAvailability.new(admin_data_item.admin_data_item_id, admin_data_item.description,
|
||||
admin_data_item.admin_data_values.where(school:, academic_year:).count > 0)
|
||||
Summary.new(admin_data_item.admin_data_item_id, admin_data_item.description,
|
||||
admin_data_item.admin_data_values.where(school:, academic_year:).count > 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,10 +27,13 @@ class TeacherSurveyPresenter < DataItemPresenter
|
|||
end
|
||||
|
||||
def descriptions_and_availability
|
||||
return [DataAvailability.new('1B-i', 'Items available upon request to MCIEA.', true)] if @measure_id == '1B-i'
|
||||
if @measure_id == '1B-i'
|
||||
return [Summary.new('1B-i', 'Items available upon request to MCIEA',
|
||||
true)]
|
||||
end
|
||||
|
||||
survey_items.map do |survey_item|
|
||||
DataAvailability.new(survey_item.survey_item_id, survey_item.prompt, true)
|
||||
Summary.new(survey_item.survey_item_id, survey_item.prompt, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue