Skip to content

Commit

Permalink
Merge branch 'release-75' into ea/6466-ruby-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders authored Feb 12, 2025
2 parents 9d72432 + e406411 commit 8ee1182
Show file tree
Hide file tree
Showing 43 changed files with 3,388 additions and 483 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: |
# Ignore files we don't control the format of
ignore_patterns="db/schema.rb\|bin/rails\|bin/rake\|bin/bundle"
files=`echo "${ALL_CHANGED_FILES}" | tr " " "\n" | grep -v $ignore_patterns | grep "**/*.rb" | tr "\n" " ./"`
files=`echo "${ALL_CHANGED_FILES}" | tr " " "\n" | grep -v $ignore_patterns | grep "**/*\.rb" | tr "\n" " ./"`
num=`echo $files | wc -w`
echo $files
if [ $num -gt 0 ]; then bundle exec rubocop --config ./.rubocop.yml $files; else echo "No changed ruby files"; fi
10 changes: 0 additions & 10 deletions app/controllers/non_hmis_assessments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def create
@assessment.update(opts)
@non_hmis_client.update(assessed_at: @assessment.entry_date) if @assessment.entry_date
if @assessment.save
enforce_no_transfer_2024!
redirect_to @non_hmis_client
else
render :new
Expand All @@ -44,21 +43,12 @@ def update
opts = clean_assessment_params(@assessment.assessment_params(params))
if @assessment.update(opts)
@non_hmis_client.update(assessed_at: @assessment.entry_date) if @assessment.entry_date
enforce_no_transfer_2024!
redirect_to @non_hmis_client
else
render :edit
end
end

# TODO: Until we have a Transfer 2024 assessment, just convert all transfer assessments to 2021 assessments
private def enforce_no_transfer_2024!
NonHmisAssessment.where(assessment_name: :DeidentifiedPathwaysVersionFourTransfer).
update_all(assessment_name: :DeidentifiedPathwaysVersionThreeTransfer, type: :DeidentifiedPathwaysVersionThree)
NonHmisAssessment.where(assessment_name: :IdentifiedPathwaysVersionFourTransfer).
update_all(assessment_name: :IdentifiedPathwaysVersionThreeTransfer, type: :IdentifiedPathwaysVersionThree)
end

def destroy
@assessment.destroy
flash[:notice] = 'Assessment successfully deleted.'
Expand Down
3 changes: 3 additions & 0 deletions app/models/cas/update_clients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ def project_client_attributes
:ongoing_es_enrollments,
:ongoing_so_enrollments,
:last_seen_projects,
:household_dv_survivor,
:disqualified_for_state_assistance,
:psh_required, # Transfer V4 Q5
]
end

Expand Down
24 changes: 24 additions & 0 deletions app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,15 @@ def need_daily_assistance_for_export
bool_for_export(need_daily_assistance)
end

def psh_required_for_export
case psh_required
when 'yes', 'no'
psh_required.capitalize
else
'Unknown'
end
end

private def numeric_bool_for_export(value)
return 'Yes' if value.to_s == '1'
return 'No' if value.to_s == '0'
Expand Down Expand Up @@ -1256,6 +1265,21 @@ def self.prioritized_columns_data
description: nil,
type: 'String',
},
household_dv_survivor: {
title: 'Household member experiencing domestic violence',
description: nil,
type: 'Boolean',
},
disqualified_for_state_assistance: {
title: 'Ineligible for state emergency assistance',
description: nil,
type: 'Boolean',
},
psh_required: {
title: 'In need of Permanent Supportive Housing',
description: nil,
type: 'String',
},
}
end

Expand Down
Loading

0 comments on commit 8ee1182

Please sign in to comment.