mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06: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
|
||||
|
||||
def original_url
|
||||
request.original_url.sub(/\?.*$/, "")
|
||||
request.original_url[/\A[^?]+/]
|
||||
end
|
||||
|
||||
def query_parameters
|
||||
|
||||
@ -20,7 +20,7 @@ module ActiveModel
|
||||
options ||= {}
|
||||
if serializer.respond_to?(:each)
|
||||
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]
|
||||
|
||||
if result[:included]
|
||||
@ -31,7 +31,7 @@ module ActiveModel
|
||||
|
||||
add_links(options)
|
||||
else
|
||||
@hash[:data] = attributes_for_serializer(serializer, {})
|
||||
@hash[:data] = attributes_for_serializer(serializer, options)
|
||||
add_resource_relationships(@hash[:data], serializer)
|
||||
end
|
||||
@hash
|
||||
|
||||
Loading…
Reference in New Issue
Block a user