app/controllers/api/base_controller/renderer.rb
def expand_virtual_attributes(json, type, resource, virtual_attrs)
        result = {}
        object_hash = {}
        virtual_attrs.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 []*.
Let ' s expand virtual attributes and related objects if asked for Supporting [] * .
def expand_virtual_attributes(json, type, resource, virtual_attrs)
        result = {}
        object_hash = {}
        virtual_attrs.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 , virtual_attrs ) result = { } object_hash = { } virtual_attrs . 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
type
resource
virtual_attrs