Skip to content

Commit 1a37cf6

Browse files
committed
Fix route presenter regression: include options: {} when empty
The INTERNAL_ROUTE_OPTIONS filtering change incorrectly suppressed the options key entirely when public_options was empty. The original behavior includes options whenever route.options is not nil, even when the hash is empty.
1 parent 3f6939c commit 1a37cf6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/presenters/v3/route_presenter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def to_hash
5050
}
5151
unless route.options.nil?
5252
public_options = route.options.reject { |k, _| INTERNAL_ROUTE_OPTIONS.include?(k.to_s) }
53-
hash.merge!(options: public_options) unless public_options.empty?
53+
hash.merge!(options: public_options)
5454
end
5555

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

0 commit comments

Comments
 (0)