app/controllers/api_controller/renderer.rb
#
# Let's expand subcollections for objects if asked for
#
Let's expand subcollections for objects if asked for
Let ' s expand subcollections for objects if asked for
def expand_subcollections(json, type, resource)
      scs = collection_config[type.to_sym][:subcollections]
      return unless scs
      scs.each do |sc|
        target = "#{sc}_query_resource"
        next unless expand_subcollection?(sc, target)
        expand_subcollection(json, sc, "#{type}/#{resource.id}/#{sc}", send(target, resource))
      end
    end
def expand_subcollections ( json , type , resource ) scs = collection_config [ type . to_sym ] [ :subcollections ] return unless scs scs . each do | sc | target = "#{sc}_query_resource" next unless expand_subcollection? ( sc , target ) expand_subcollection ( json , sc , "#{type}/#{resource.id}/#{sc}" , send ( target , resource ) ) end end
Let's expand subcollections for objects if asked for
Let ' s expand subcollections for objects if asked for
json
<not_specific>
type
<not_specific>
resource
<not_specific>