Skip to content

Commit 3c3578a

Browse files
committed
improvements on how to get self link on pagination class
1 parent f85027e commit 3c3578a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/active_model/serializer/adapter/json_api/pagination_links.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def pages_from
4141
end
4242

4343
def url(options)
44-
self_link = options.fetch(:links) {{}}
45-
self_link.fetch(:self) {} ? options[:links][:self] : original_url
44+
@url ||= options.fetch(:links, {}).fetch(:self, nil) || original_url
4645
end
4746

4847
def original_url

0 commit comments

Comments
 (0)