Compare commits

...

2 Commits

@ -19,7 +19,7 @@ jobs:
# needed because the postgres container does not provide a healthcheck
# tmpfs makes DB faster by using RAM
options: >-
--mount type=tmpfs,destination=/var/lib/postgresql/data
--mount type=tmpfs,destination=/var/lib/postgresql
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s

@ -54,6 +54,7 @@ group :development do
gem 'rubocop-rspec', require: false
gem 'rubocop-rspec_rails'
gem 'seed_dump'
gem 'solargraph'
gem 'solargraph-reek'
gem 'spring'
# gem "web-console"

@ -386,7 +386,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (3.9.4)
rbs (3.9.5)
logger
rdoc (6.14.0)
erb
@ -481,7 +481,7 @@ GEM
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
solargraph (0.55.1)
solargraph (0.57.0)
backport (~> 1.2)
benchmark (~> 0.4)
bundler (~> 2.0)
@ -493,12 +493,14 @@ GEM
observer (~> 0.1)
ostruct (~> 0.6)
parser (~> 3.0)
rbs (~> 3.3)
prism (~> 1.4)
rbs (>= 3.6.1, <= 4.0.0.dev.4)
reverse_markdown (~> 3.0)
rubocop (~> 1.38)
rubocop (~> 1.76)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
yard-activesupport-concern (~> 0.0)
yard-solargraph (~> 0.1)
solargraph-reek (0.1.1)
reek (>= 5.0)
@ -517,7 +519,7 @@ GEM
railties (>= 6.0.0)
stringio (3.1.7)
thor (1.3.2)
tilt (2.6.0)
tilt (2.6.1)
timeout (0.4.3)
trollop (2.9.10)
turbo-rails (2.0.16)
@ -545,6 +547,8 @@ GEM
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.37)
yard-activesupport-concern (0.0.1)
yard (>= 0.8)
yard-solargraph (0.1.0)
yard (~> 0.9)
zeitwerk (2.7.3)
@ -607,6 +611,7 @@ DEPENDENCIES
rubocop-rspec_rails
seed_dump
simplecov
solargraph
solargraph-reek
spring
sprockets-rails

@ -69,6 +69,6 @@ module AnalyzeHelper
def base_url
analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @presenter.category,
subcategory: @presenter.subcategory)
subcategory: @presenter.subcategory)
end
end

@ -2,7 +2,7 @@ class Benefit < ApplicationRecord
scope :by_designation, -> { all.map { |benefits| [benefits.designation, benefits] }.to_h }
def self.to_designation(benefits)
return "Unknown" if benefits.blank? or benefits.nil?
return "Unknown" if benefits.blank? || benefits.nil?
case benefits
in /^1$/i

@ -2,7 +2,7 @@ class Education < ApplicationRecord
scope :by_designation, -> { all.map { |education| [education.designation, education] }.to_h }
def self.to_designation(education)
return "Unknown" if education.blank? or education.nil?
return "Unknown" if education.blank? || education.nil?
case education
in /^1$/i

@ -2,7 +2,7 @@ class Employment < ApplicationRecord
scope :by_designation, -> { all.map { |employment| [employment.designation, employment] }.to_h }
def self.to_designation(employment)
return "Unknown" if employment.blank? or employment.nil?
return "Unknown" if employment.blank? || employment.nil?
case employment
in /^1$|^1100$/i

@ -11,7 +11,7 @@ module Analyze
end
def label
["#{ell.designation}"]
[ell.designation.to_s]
end
def basis

@ -11,7 +11,7 @@ module Analyze
end
def label
["#{gender.designation}"]
[gender.designation.to_s]
end
def basis

@ -11,7 +11,7 @@ module Analyze
end
def label
["#{grade}"]
[grade.to_s]
end
def basis

@ -11,7 +11,7 @@ module Analyze
end
def label
["#{sped.designation}"]
[sped.designation.to_s]
end
def basis

@ -49,7 +49,7 @@ class SurveyResponsesDataLoader
workers = pool_size.times.map do
Thread.new do
while slice = jobs.pop(true)
while (slice = jobs.pop(true))
slice.each do |line|
survey_item_responses = []

@ -13,32 +13,6 @@
<div class="d-flex flex-column mx-7">
<p class="body-large "><%= subcategory.description %></p>
<div class="d-flex justify-content-start">
<div
class="body-large text-center response-rate"
data-bs-toggle="popover"
data-bs-trigger="hover focus"
data-bs-content="The number of publicly available school data sources, often collected from the MA Department of Elementary and Secondary Education."
data-bs-placement="bottom"
>
<p class="response-rate-percentage"><%= subcategory.admin_collection_rate.first %> / <%= subcategory.admin_collection_rate.last %></p>
<p>school data sources</p>
</div>
<div
class="body-large mx-3 text-center response-rate"
data-bs-toggle="popover"
data-bs-trigger="hover focus"
data-bs-content="The student survey response rate for this sub-category. This number differs from the overall response rate because each individual student receives 44 of 67 total questions, in order to avoid survey fatigue. This number is also adjusted to reflect any instances where a student has decided to skip a survey question."
data-bs-placement="bottom"
>
<p class="response-rate-percentage"><%= subcategory.student_response_rate %></p>
<p>of students responded</p>
</div>
<div class="body-large text-center response-rate" >
<p class="response-rate-percentage"><%= subcategory.teacher_response_rate %></p>
<p>of teachers responded</p>
</div>
</div>
</div>
</div>
</div>

@ -39,14 +39,14 @@ namespace :upload do
upload_filename = filename.split('sqm-dashboards')[1][1..]
upload_directory = upload_filename.rpartition('/').first
tmp_dir = upload_directory + '/'
tmp_dir = "#{upload_directory}/"
parent_dir = "/"
while tmp_dir.include?('/')
first_dir = tmp_dir.split('/').first
sftp.mkdir!("#{parent_dir}#{first_dir}/") unless sftp.dir.entries(parent_dir).map(&:name).include?(first_dir)
parent_dir += first_dir + '/'
parent_dir += "#{first_dir}/"
tmp_dir = tmp_dir.split('/')[1..].join('/')
end
sftp.mkdir!("#{parent_dir}#{tmp_dir}/") unless sftp.dir.entries(parent_dir).map(&:name).include?(first_dir)

@ -462,7 +462,7 @@ RSpec.describe SurveyItemValues, type: :model do
it "returns an unknown race" do
row = {"Race-1" => ""}
row.keys.each do |key|
row.each_key do |key|
headers << key
end
@ -475,7 +475,7 @@ RSpec.describe SurveyItemValues, type: :model do
it "returns an unknown race" do
row = {"Race-1" => "99", "Race-2" => "99", "Race-3" => "", "Race-4" => "nil"}
row.keys.each do |key|
row.each_key do |key|
headers << key
end
@ -488,15 +488,15 @@ RSpec.describe SurveyItemValues, type: :model do
context "for defined races" do
it "returns the qualtrics code of that race" do
[1,2,3,4,5,8].each do |i|
row = {"Race-1" => "#{i}"}
[1, 2, 3, 4, 5, 8].each do |i|
row = {"Race-1" => i.to_s}
row.keys.each do |key|
headers << key
end
row.each_key do |key|
headers << key
end
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.races_of_children).to eq [i]
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.races_of_children).to eq [i]
end
end
end
@ -506,7 +506,7 @@ RSpec.describe SurveyItemValues, type: :model do
row = {"Race-1" => "6"}
row.keys.each do |key|
row.each_key do |key|
headers << key
end
@ -515,7 +515,7 @@ RSpec.describe SurveyItemValues, type: :model do
row = {"Race-1" => "7"}
row.keys.each do |key|
row.each_key do |key|
headers << key
end
@ -530,14 +530,14 @@ RSpec.describe SurveyItemValues, type: :model do
context "when there is more than one race defined" do
it "returns the qualtrics code for the two races and the designation for multiracial(100)" do
row = {"Race-1" => "1", "Race-2" => "2","Race-3" => "3"}
row = {"Race-1" => "1", "Race-2" => "2", "Race-3" => "3"}
row.keys.each do |key|
headers << key
end
row.each_key do |key|
headers << key
end
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.races_of_children).to eq [1,2,3,100]
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.races_of_children).to eq [1, 2, 3, 100]
end
end

@ -368,16 +368,16 @@ describe SurveyResponsesDataLoader do
it "returns -1 when any aspect of the data is unknown" do
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Associates Degree"), Benefit.new(designation: "Unknown"), [Employment.new(designation: "Two adults with full-time employment")])
expect(score).to eq -1
expect(score).to eq(-1)
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Associates Degree"), Benefit.new(designation: "No"), [Employment.new(designation: "Unknown")])
expect(score).to eq -1
expect(score).to eq(-1)
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Unknown"), Benefit.new(designation: "No"), [Employment.new(designation: "No full-time or part-time employment")])
expect(score).to eq -1
expect(score).to eq(-1)
score = SocioEconomicCalculator.socio_economic_score(Education.new(designation: "Unknown"), Benefit.new(designation: "No"), [])
expect(score).to eq -1
expect(score).to eq(-1)
end
end
end

Loading…
Cancel
Save