mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56: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
|
end
|
||||||
|
|
||||||
def url(options)
|
def url(options)
|
||||||
self_link = options.fetch(:links) {{}}
|
@url ||= options.fetch(:links, {}).fetch(:self, nil) || original_url
|
||||||
self_link.fetch(:self) {} ? options[:links][:self] : original_url
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def original_url
|
def original_url
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user