Module: CanCan::Relevant

Included in:
Rule
Defined in:
lib/cancan/relevant.rb

Instance Method Summary collapse

Instance Method Details

#relevant?(action, subject) ⇒ Boolean

Matches both the action, subject, and attribute, not necessarily the conditions

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/cancan/relevant.rb', line 6

def relevant?(action, subject)
  subject = subject.values.first if subject.class == Hash
  @match_all || (matches_action?(action) && matches_subject?(subject))
end