Skip to content

Commit

Permalink
compact for multiple belongs_to suppo
Browse files Browse the repository at this point in the history
  • Loading branch information
ollizeyen committed Feb 16, 2021
1 parent 9b9835b commit 3b799a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/json_api_client/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,15 @@ def _prefix_path
a.to_prefix_path(route_formatter)
end

paths.join("/")
paths.compact.join("/")
end

def _set_prefix_path(attrs)
paths = _belongs_to_associations.map do |a|
a.set_prefix_path(attrs, route_formatter)
end

paths.join("/")
paths.compact.join("/")
end

def _new_scope
Expand Down

0 comments on commit 3b799a3

Please sign in to comment.