Skip to content

Commit f86928b

Browse files
committed
Store resource_type in local (Code Climate)
1 parent 80e48e5 commit f86928b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/graphiti/query.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ def hash
4848
h[:sort] = sorts
4949
h[:page] = pagination
5050
if association?
51+
resource_type = @resource.class.type
5152
h[:extra_fields] = {
52-
@resource.class.type => extra_fields[@resource.class.type]
53-
} if extra_fields.key?(@resource.class.type)
53+
resource_type => extra_fields[resource_type]
54+
} if extra_fields.key?(resource_type)
5455
else
5556
h[:fields] = fields
5657
h[:extra_fields] = extra_fields

0 commit comments

Comments
 (0)