Exception: ActionPolicy::NotFound

Inherits:
Error
  • Object
show all
Defined in:
lib/action_policy.rb

Overview

Raised when Action Policy fails to find a policy class for a record.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ NotFound

Returns a new instance of NotFound.



14
15
16
17
# File 'lib/action_policy.rb', line 14

def initialize(target)
  @target = target
  @message = "Couldn't find policy class for #{target.inspect}"
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



12
13
14
# File 'lib/action_policy.rb', line 12

def message
  @message
end

#targetObject (readonly)

Returns the value of attribute target.



12
13
14
# File 'lib/action_policy.rb', line 12

def target
  @target
end