mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 06:16:40 +00:00
[UTIL] Set up params
correctly in the Ruby template
When no params are specified in the spec, set `params` to empty Hash.
This commit is contained in:
parent
e541dc14a3
commit
c1d2ada564
@ -47,6 +47,8 @@ module Elasticsearch
|
||||
<%= ' '*@namespace_depth %> end
|
||||
<%= ' '*@namespace_depth %> # Normalize Ruby 1.8 and Ruby 1.9 Hash#select behaviour
|
||||
<%= ' '*@namespace_depth %> params = Hash[params] unless params.is_a?(Hash)
|
||||
<%- else -%>
|
||||
<%= ' '*@namespace_depth %> params = {}
|
||||
<%- end -%>
|
||||
<%= ' '*@namespace_depth %> body = <%= @spec['body'].nil? ? 'nil' : 'arguments[:body]' %>
|
||||
<%# Perform request %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user