app/controllers/api_controller/renderer.rb
#
# Let's expand virtual attributes and related objects if asked for
# Supporting [<related_object>]*.<virtual_attribute>
#
Let's expand virtual attributes and related objects if asked for
Supporting []*.
Let ' s expand virtual attributes and related objects if asked for Supporting [] * .
def expand_virtual_attributes(json, type, resource)
      result = {}
      object_hash = {}
      virtual_attributes_list(resource).each do |vattr|
        attr_name, attr_base = split_virtual_attribute(vattr)
        value, value_result = if attr_base.blank?
                                fetch_direct_virtual_attribute(type, resource, attr_name)
                              else
                                fetch_indirect_virtual_attribute(type, resource, attr_base, attr_name, object_hash)
                              end
        result = result.deep_merge(value_result) unless value.nil?
      end
      add_hash json, result
    end
def expand_virtual_attributes ( json , type , resource ) result = { } object_hash = { } virtual_attributes_list ( resource ) . each do | vattr | attr_name , attr_base = split_virtual_attribute ( vattr ) value , value_result = if attr_base . blank? fetch_direct_virtual_attribute ( type , resource , attr_name ) else fetch_indirect_virtual_attribute ( type , resource , attr_base , attr_name , object_hash ) end result = result . deep_merge ( value_result ) unless value . nil? end add_hash json , result end
Let's expand virtual attributes and related objects if asked for
Supporting [<related_object>]*.<virtual_attribute>
Let ' s expand virtual attributes and related objects if asked for Supporting [ <related_object > ] * . <virtual_attribute >
json
<not_specific>
type
<not_specific>
resource
<not_specific>