-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
# model with associations
class Foo < ActiveRecord::Base
phi_model
belongs_to :bar
has_many :baz
extend_phi_access :bar, :baz
end
# setup associations
foo = Foo.new
bar = Bar.new
baz = Baz.new
foo.bar = bar
foo.baz << baz
# PHI access is not extended until we call the wrapped method
foo.allow_phi!('me', 'reason')
foo.association(:bar).reader.phi_allowed? # => false
foo.bar.phi_allowed? # => true
foo.association(:bar).reader.phi_allowed? # => true
# desired outcome
foo.allow_phi!('me', 'reason')
foo.association(:bar).reader.phi_allowed? # => true
foo.bar.phi_allowed? # => true
foo.association(:bar).reader.phi_allowed? # => trueWe should update allow_phi! to proactively iterate over PHI extensions and call allow PHI on them.
Metadata
Metadata
Assignees
Labels
No labels