Skip to content

Commit 3b799a3

Browse files
committed
compact for multiple belongs_to suppo
1 parent 9b9835b commit 3b799a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/json_api_client/resource.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,15 @@ def _prefix_path
313313
a.to_prefix_path(route_formatter)
314314
end
315315

316-
paths.join("/")
316+
paths.compact.join("/")
317317
end
318318

319319
def _set_prefix_path(attrs)
320320
paths = _belongs_to_associations.map do |a|
321321
a.set_prefix_path(attrs, route_formatter)
322322
end
323323

324-
paths.join("/")
324+
paths.compact.join("/")
325325
end
326326

327327
def _new_scope

0 commit comments

Comments
 (0)