Module: Protector::InheritedResources::ClassMethods

Defined in:
lib/protector/inherited_resources/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#effective_protector_subjectObject



8
9
10
11
12
13
14
15
16
# File 'lib/protector/inherited_resources/class_methods.rb', line 8

def effective_protector_subject
  return @protector_subject unless @protector_subject.nil?
  
  if superclass.respond_to? :effective_protector_subject
    superclass.effective_protector_subject
  else
    :current_user
  end
end

#protector_subject(subject) ⇒ Object



3
4
5
6
# File 'lib/protector/inherited_resources/class_methods.rb', line 3

def protector_subject(subject)
  subject = false if subject.nil?
  @protector_subject = subject
end