app/controllers/api_controller/renderer.rb
#
# Helper proc for rendering a collection of type specified.
#
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
def gen_action_spec_for_collections(collection, cspec, is_subcollection, href)
      target = is_subcollection ? :subcollection_actions : :collection_actions
      return [] unless cspec.key?(target)
      cspec[target].each.collect do |method, action_definitions|
        next unless render_actions_for_method(cspec[:methods], method)
        typed_action_definitions = fetch_typed_subcollection_actions(method, is_subcollection) || action_definitions
        typed_action_definitions.each.collect do |action|
          if !action[:disabled] && api_user_role_allows?(action[:identifier])
            {"name" => action[:name], "method" => method, "href" => (href ? href : collection)}
          end
        end
      end.flatten.compact
    end
def gen_action_spec_for_collections ( collection , cspec , is_subcollection , href ) target = is_subcollection ? :subcollection_actions : :collection_actions return [ ] unless cspec . key? ( target ) cspec [ target ] . each . collect do | method , action_definitions | next unless render_actions_for_method ( cspec [ :methods ] , method ) typed_action_definitions = fetch_typed_subcollection_actions ( method , is_subcollection ) || action_definitions typed_action_definitions . each . collect do | action | if ! action [ :disabled ] && api_user_role_allows? ( action [ :identifier ] ) { "name" => action [ :name ] , "method" => method , "href" => ( href ? href : collection ) } end end end . flatten . compact end
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
collection
<not_specific>
cspec
<not_specific>
is_subcollection
<not_specific>
href
<not_specific>