Skip to content

Commit

Permalink
Comment on residential-ness of SO
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders committed Feb 11, 2025
1 parent c7be3e2 commit d713fb2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/models/grda_warehouse/hud/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ class Project < Base
# Needs to come after has_many :enrollments, bc one extension uses a has_many through: :enrollments relation
include RailsDrivers::Extensions

# A scope to return any projects that are residential (provide housing). Generally, and
# completely before the FY2024 data standards, this is based on project type. In FY2024
# A scope to return any projects that are residential (provide housing or indicate where someone was living).
# Generally, and completely before the FY2024 data standards, this is based on project type. In FY2024
# Project Type 13 (RRH) was given an RRHSubType column to indicate if it was a services only
# project or if it included housing.
# This handles the RRH Sub Type given a set of project IDs so as to return residential projects
# Note that Street Outreach is included in this set even though no one is "providing housing" in
# that situation. This is included as valid SO enrollments require at least one night (and one CLS)
# and are an indication of where someone was residing.
scope :_residential_for_project_type_ids, ->(project_type_ids) do
project_type_ids = Array.wrap(project_type_ids)
return where(project_type: project_type_ids) unless project_type_ids.include?(13)
Expand Down

0 comments on commit d713fb2

Please sign in to comment.