lib/cancan/ability/actions.rb
# Accepts an array of actions and returns an array of actions which match.
# This should be called before "matches?" and other checking methods since they
# rely on the actions to be expanded.
Accepts an array of actions and returns an array of actions which match.
This should be called before "matches?" and other checking methods since they
rely on the actions to be expanded.
Accepts an array of actions and returns an array of actions which match . This should be called before " matches? " and other checking methods since they rely on the actions to be expanded .
def expand_actions(actions)
        expanded_actions[actions] ||= begin
          expanded = []
          actions.each do |action|
            expanded << action
            if (aliases = aliased_actions[action])
              expanded += expand_actions(aliases)
            end
          end
          expanded
        end
      end
def expand_actions ( actions ) expanded_actions [ actions ] ||= begin expanded = [ ] actions . each do | action | expanded << action if ( aliases = aliased_actions [ action ] ) expanded += expand_actions ( aliases ) end end expanded end end
Accepts an array of actions and returns an array of actions which match.
Accepts an array of actions and returns an array of actions which match .
actions
<not_specific>