mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
exchange to a faster regex to get origina_url
This commit is contained in:
parent
77a8f66ad8
commit
59ae84baba
@ -63,7 +63,7 @@ module ActionController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def original_url
|
def original_url
|
||||||
request.original_url.sub(/\?.*$/, "")
|
request.original_url[/\A[^?]+/]
|
||||||
end
|
end
|
||||||
|
|
||||||
def query_parameters
|
def query_parameters
|
||||||
|
|||||||
@ -20,7 +20,7 @@ module ActiveModel
|
|||||||
options ||= {}
|
options ||= {}
|
||||||
if serializer.respond_to?(:each)
|
if serializer.respond_to?(:each)
|
||||||
serializer.each do |s|
|
serializer.each do |s|
|
||||||
result = self.class.new(s, @options.merge(fieldset: @fieldset)).serializable_hash({})
|
result = self.class.new(s, @options.merge(fieldset: @fieldset)).serializable_hash(options)
|
||||||
@hash[:data] << result[:data]
|
@hash[:data] << result[:data]
|
||||||
|
|
||||||
if result[:included]
|
if result[:included]
|
||||||
@ -31,7 +31,7 @@ module ActiveModel
|
|||||||
|
|
||||||
add_links(options)
|
add_links(options)
|
||||||
else
|
else
|
||||||
@hash[:data] = attributes_for_serializer(serializer, {})
|
@hash[:data] = attributes_for_serializer(serializer, options)
|
||||||
add_resource_relationships(@hash[:data], serializer)
|
add_resource_relationships(@hash[:data], serializer)
|
||||||
end
|
end
|
||||||
@hash
|
@hash
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user