Skip to content

Commit 947077a

Browse files
committed
Merge pull request #597 from Precogs-com/master
underscorize resource type name in links
2 parents 4defb2a + 83a6db8 commit 947077a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/jsonapi/resource_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def foreign_key_types_and_values(source, relationship)
307307
if relationship.is_a?(JSONAPI::Relationship::ToMany)
308308
if relationship.polymorphic?
309309
source._model.public_send(relationship.name).pluck(:type, :id).map do |type, id|
310-
[type.pluralize, IdValueFormatter.format(id)]
310+
[type.underscore.pluralize, IdValueFormatter.format(id)]
311311
end
312312
else
313313
source.public_send(relationship.foreign_key).map do |value|

0 commit comments

Comments
 (0)