CanCan::Rule
Constructors
new(base_behavior : Bool, actions : Symbol | Array(Symbol) | Nil, subjects : Subject | Array(Subject) | Nil, attributes : Array(Symbol) | Nil = nil, conditions : CondVal = nil, block : Proc(BlockSubject, Bool) | Nil = nil, catch_all_block : Proc(Symbol, CatchAllClass, ActiveRecord::Base | Nil, Bool) | Nil = nil, attr_block : Proc(BlockSubject, Symbol | Nil, Bool) | Nil = nil)
Instance methods
actions
attr_block
attributes
attributes_from_conditions
base_behavior
block
can_rule?
cannot_catch_all?
catch_all?
The gem's catch_all?: blank conditions (nil / empty hash / empty scope) match everything.
catch_all_block
conditions
conditions_empty?
inspect
Gem Rule#inspect: #<CanCan::Rulecan [:read], [Article(id: integer, ...)], [:title], {}> (subjects render through Model.inspect).
match_all?
--- ConditionsMatcher ---
Nested subject (can? :read, parent => child in the gem): the child
class drives relevance; conditions are matched against the PARENT
through the belongs_to association name, plus the foreign-key
condition check against parent.id (AR adapter semantics).
only_block?
only_raw_sql?
subjects