@@ -123,8 +123,8 @@ def object_hash(source, requested_associations)
123123 obj_hash = attribute_hash ( source )
124124 links = links_hash ( source , requested_associations )
125125
126- obj_hash [ format_key ( 'type' ) ] = format_value ( source . class . _type . to_s , :default , source )
127- obj_hash [ format_key ( 'id' ) ] ||= format_value ( source . id , :id , source )
126+ obj_hash [ 'type' ] = format_key ( source . class . _type . to_s )
127+ obj_hash [ 'id' ] ||= format_value ( source . id , :id , source )
128128 obj_hash . merge! ( { links : links } ) unless links . empty?
129129 return obj_hash
130130 end
@@ -244,7 +244,7 @@ def has_one_linkage(source, association)
244244 linkage = { }
245245 linkage_id = foreign_key_value ( source , association )
246246 if linkage_id
247- linkage [ :type ] = format_route ( association . type )
247+ linkage [ :type ] = format_key ( association . type )
248248 linkage [ :id ] = linkage_id
249249 else
250250 linkage = nil
@@ -256,7 +256,7 @@ def has_many_linkage(source, association)
256256 linkage = [ ]
257257 linkage_ids = foreign_key_value ( source , association )
258258 linkage_ids . each do |linkage_id |
259- linkage . append ( { type : format_route ( association . type ) , id : linkage_id } )
259+ linkage . append ( { type : format_key ( association . type ) , id : linkage_id } )
260260 end
261261 linkage
262262 end
0 commit comments