mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-09 07:18:13 -07:00
dirty commit: can't get references to work correctly between any tables
This commit is contained in:
parent
e1f0b78236
commit
a4fddbeced
183 changed files with 5461 additions and 5 deletions
29
app/presenters/dashboard/admin_data_presenter.rb
Normal file
29
app/presenters/dashboard/admin_data_presenter.rb
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Dashboard
|
||||
class AdminDataPresenter < DataItemPresenter
|
||||
def initialize(measure_id:, admin_data_items:, has_sufficient_data:, school:, academic_year:)
|
||||
super(measure_id:, has_sufficient_data:, school:, academic_year:)
|
||||
@admin_data_items = admin_data_items
|
||||
end
|
||||
|
||||
def title
|
||||
"School admin data"
|
||||
end
|
||||
|
||||
def id
|
||||
"admin-data-items-#{@measure_id}"
|
||||
end
|
||||
|
||||
def reason_for_insufficiency
|
||||
"limited availability"
|
||||
end
|
||||
|
||||
def descriptions_and_availability
|
||||
@admin_data_items.map do |admin_data_item|
|
||||
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
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue