Skip to content

Commit

Permalink
Rescue and log errors with VAProfileRedisDemographics inside user model.
Browse files Browse the repository at this point in the history
Comment above is where policy check may go
  • Loading branch information
dcloud committed Oct 25, 2024
1 parent 6d0a0a8 commit e3677c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,12 @@ def onboarding
end

def demographics_info
# return nil unless DemographicsPolicy.new(self).access? && MPIPolicy.new(self).queryable?

@demographics_info ||= VAProfileRedis::Demographics.for_user(self)
rescue => e
Rails.logger.info('[User] VAProfileRedis::Demographics error', e.message)
nil
end

def demographics
Expand Down

0 comments on commit e3677c1

Please sign in to comment.