Skip to content

Commit bce5bea

Browse files
committed
Fix serializable resource extensions.
1 parent af06838 commit bce5bea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/jsonapi/rails/deserializable/resource_extensions.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ module Deserializable
66
module ResourceExtensions
77
def deserialize_has_one_rel!(rel, &block)
88
id = rel['data'] && rel['data']['id']
9-
type = rel['data'] && rel['data']['type'].singularize.constantize
9+
type = rel['data'] && rel['data']['type'].singularize.camelize
1010
instance_exec(rel, id, type, &block)
1111
end
1212

1313
def deserialize_has_many_rel!(rel, &block)
1414
ids = rel['data'].map { |ri| ri['id'] }
15-
types = rel['data'].map { |ri| ri['type'].singularize.constantize }
15+
types = rel['data'].map { |ri| ri['type'].singularize.camelize }
1616
instance_exec(rel, ids, types, &block)
1717
end
1818
end

0 commit comments

Comments
 (0)