Module: Protector::Adapters::ActiveRecord::Association

Extended by:
ActiveSupport::Concern
Defined in:
lib/protector/adapters/active_record/association.rb

Overview

Patches ActiveRecord::Associations::SingularAssociation and ActiveRecord::Associations::CollectionAssociation

Instance Method Summary collapse

Instance Method Details

#scope_with_protector(*args) ⇒ Object

Wraps every association with current subject



19
20
21
# File 'lib/protector/adapters/active_record/association.rb', line 19

def scope_with_protector(*args)
  scope_without_protector(*args).restrict!(owner.protector_subject)
end