lib/quirky-api/serializers/quirky_serializer.rb
# Returns requested associations.  This also validates the presence of
# associations on the request, if configured.
#
# @see QuirkyApi.configuration
#
# @raises InvalidAssociation
# @returns [Array] An array of valid associations.
Returns requested associations.  This also validates the presence of
associations on the request, if configured.
Returns requested associations . This also validates the presence of associations on the request if configured .
def _associations
    returned = @associations & [*@opts[:associations]].map(&:to_sym)
    return returned unless QuirkyApi.validate_associations
    if returned.blank? || returned.length != [*@opts[:associations]].length
      ([*@opts[:associations]].map(&:to_sym) - @associations).each do |assoc|
        fail InvalidAssociation,
             "The '#{assoc}' association does not exist."
      end
    end
    returned
  end
def _associations returned = @associations & [ * @opts [ :associations ] ] . map ( & :to_sym ) return returned unless QuirkyApi . validate_associations if returned . blank? || returned . length != [ * @opts [ :associations ] ] . length ( [ * @opts [ :associations ] ] . map ( & :to_sym ) - @associations ) . each do | assoc | fail InvalidAssociation , "The '#{assoc}' association does not exist." end end returned end
Returns requested associations.
Returns requested associations .
# Stop here unless we want to throw exceptions for bad associations. # Find invalid associations and throw an exception for them.
[Array] An array of valid associations.
[ Array ] An array of valid associations .
None
see
None