Skip to content

Commit 4816eba

Browse files
committed
Omit options if null
1 parent d6becf3 commit 4816eba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/presenters/v3/route_presenter.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def to_hash
3434
port: route.port,
3535
url: build_url,
3636
destinations: RouteDestinationsPresenter.new(route.route_mappings, route:).presented_destinations,
37-
options: route.options,
3837
metadata: {
3938
labels: hashified_labels(route.labels),
4039
annotations: hashified_annotations(route.annotations)
@@ -49,6 +48,9 @@ def to_hash
4948
},
5049
links: build_links
5150
}
51+
unless route.options.nil?
52+
hash.merge!(options: route.options)
53+
end
5254

5355
@decorators.reduce(hash) { |memo, d| d.decorate(memo, [route]) }
5456
end

0 commit comments

Comments
 (0)