Skip to content

Commit

Permalink
Address feedback - explicit check for owner type
Browse files Browse the repository at this point in the history
  • Loading branch information
gigxz committed Feb 2, 2025
1 parent 98b0a3d commit 04bd402
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ def columns
end

private def pathway_cded_key_to_id
@pathway_cded_key_to_id ||= Hmis::Hud::CustomDataElementDefinition.where(key: PATHWAY_KEYS).pluck(:key, :id).to_h
@pathway_cded_key_to_id ||= Hmis::Hud::CustomDataElementDefinition.where(key: PATHWAY_KEYS, owner_type: 'Hmis::Hud::Client').pluck(:key, :id).to_h
end

private def pathways_by_client_id
@pathways_by_client_id ||= Hmis::Hud::CustomDataElement.
where(data_element_definition_id: pathway_cded_key_to_id.values). # All Pathway-related definitions
where(owner_type: 'Hmis::Hud::Client').
group_by(&:owner_id) # By Client ID
end

Expand Down

0 comments on commit 04bd402

Please sign in to comment.