Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed family report builder showing community program stream #2272

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/concerns/case_note_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def permit_case_note_params
:meeting_date, :attendee, :interaction_type, :custom, :note, :custom_assessment_setting_id, :draft,
case_note_domain_groups_attributes: [
:id, :note, :domain_group_id, :task_ids
]
]
)
end

Expand Down
9 changes: 5 additions & 4 deletions app/models/enrollment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def self.properties_by(value)
# def short_enrollment_date
# enrollment_date.end_of_month.strftime '%b-%y'
# end
def self.cache_program_steams
Rails.cache.fetch([Apartment::Tenant.current, 'Enrollment', 'cache_program_steams']) do
program_ids = Enrollment.pluck(:program_stream_id).uniq
def self.cache_program_steams(type = 'Family')
Rails.cache.fetch([Apartment::Tenant.current, 'Enrollment', type, 'cache_program_steams']) do
program_ids = Enrollment.where(programmable_type: type).pluck(:program_stream_id).uniq
ProgramStream.where(id: program_ids).order(:name).to_a
end
end
Expand Down Expand Up @@ -89,6 +89,7 @@ def enrollment_date_value
end

def flash_cache
Rails.cache.delete([Apartment::Tenant.current, 'Enrollment', 'cache_program_steams'])
cache_keys = Rails.cache.instance_variable_get(:@data).keys.reject { |key| key[/#{Apartment::Tenant.current}\/.*cache_program_steams/].blank? }
cache_keys.each { |key| Rails.cache.delete(key) }
end
end