apsislabs / phi_attrs

HIPAA compliant PHI access logging for Ruby on Rails.
MIT License
27 stars 3 forks source link

Hook into ActiveRecord::Persistance#reload #3

Closed wkirby closed 5 years ago

wkirby commented 6 years ago

This may be unnecessary depending on the implementation of #2, but right now, if you do something like:

class PatientInfo < ActiveRecord::Base
  phi_model
end

class Patient < ActiveRecord::Base
  has_one :patient_info
  phi_model
end

patient = Patient.find(1)
patient.allow_phi!('test', 'test')
patient.patient_info.allow_phi!('test', 'test')

patient.patient_info.first_name #=> 'John'

patient.reload!

patient.patient_info.first_name #=> raise PHI Access Exception

We might be able to hook into reload to re-call allow_phi! for all the models that are currently allowed to access PHI.

HenryKeiter commented 5 years ago

This seems to have been addressed.