     attributes[resource.klass().primaryKey] = data[resource.klass().primaryKey].toString()
     attributes = @addRelationshipsToAttributes(attributes, data['relationships'], includes, resource)
 
-    resource.__assignFields(toCamelCase(attributes))
+    resource.__assignFields(this.toCamelCase(attributes))
 
     resource.__links = _.pick(data['links'], 'self')
     resource.klass().reflectOnAllAssociations().each (reflection) ->

  #
  # @param [Object] sortObject the object defining sorting columns
  # @return [String] a JSON API formatted string that defines sorting
  buildSortList = (sortObject) ->
    output = []
    for column, dir of sortObject
      if dir == 'asc'

  #   @see #post
  patch: (url, resourceData, options = {}) ->
    data = {
      data: this.buildResourceDocument({
        resourceData: resourceData,
        onlyResourceIdentifiers: options['onlyResourceIdentifiers'],
        onlyChanged: true
