mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
improvements on how to get self link on pagination class
This commit is contained in:
parent
f85027e631
commit
3c3578a9b8
@ -41,8 +41,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def url(options)
|
||||
self_link = options.fetch(:links) {{}}
|
||||
self_link.fetch(:self) {} ? options[:links][:self] : original_url
|
||||
@url ||= options.fetch(:links, {}).fetch(:self, nil) || original_url
|
||||
end
|
||||
|
||||
def original_url
|
||||
|
||||
Loading…
Reference in New Issue
Block a user