Skip to content

Commit

Permalink
revert change to Practice scope
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeFraties committed Oct 16, 2023
1 parent f09d552 commit 295a6e5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/practice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ def highlight_attachment_s3_presigned_url(style = nil)

scope :get_by_created_facility, -> (facility_id) { where(initiating_facility_type: 'facility').joins(:practice_origin_facilities).where(practice_origin_facilities: { va_facility_id: facility_id }).uniq }
scope :get_by_created_facility_and_crh, -> (facility_id, crh_id) { where(initiating_facility_type: 'facility').joins(:practice_origin_facilities).where(practice_origin_facilities: { va_facility_id: facility_id }).or(where(initiating_facility_type: 'facility').joins(:practice_origin_facilities).where(practice_origin_facilities: { clinical_resource_hub_id: crh_id })).uniq }
scope :get_by_created_crh, -> (crh_id) {
joins(:practice_origin_facilities).where(practice_origin_facilities: { clinical_resource_hub_id: crh_id }).distinct
}
scope :get_by_created_crh, -> (crh_id) { where(practice_origin_facilities: { clinical_resource_hub_id: crh_id }).uniq }

scope :load_associations, -> { includes(:categories, :diffusion_histories, :practice_origin_facilities) }
scope :public_facing, -> { published_enabled_approved.where(is_public: true) }
scope :get_with_va_facility_diffusion_histories, -> { published_enabled_approved.sort_a_to_z.joins(:diffusion_histories).where(diffusion_histories: { clinical_resource_hub_id: nil }).uniq }
Expand Down

0 comments on commit 295a6e5

Please sign in to comment.