projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17755: Merge branch 'main' into 17755-add-singularity-to-compute-image
[arvados.git]
/
services
/
api
/
lib
/
load_param.rb
diff --git
a/services/api/lib/load_param.rb
b/services/api/lib/load_param.rb
index e7cb21fc77e579dd75bd89543477425f0af1746b..7119eb234800bf12e1460983ed7950ff9e0e4819 100644
(file)
--- a/
services/api/lib/load_param.rb
+++ b/
services/api/lib/load_param.rb
@@
-17,7
+17,7
@@
module LoadParam
def load_where_param
if params[:where].nil? or params[:where] == ""
@where = {}
def load_where_param
if params[:where].nil? or params[:where] == ""
@where = {}
- elsif
params[:where].is_a? Hash
+ elsif
[Hash, ActionController::Parameters].include? params[:where].class
@where = params[:where]
elsif params[:where].is_a? String
begin
@where = params[:where]
elsif params[:where].is_a? String
begin
@@
-56,7
+56,7
@@
module LoadParam
raise ArgumentError.new("Invalid value for limit parameter")
end
@limit = [params[:limit].to_i,
raise ArgumentError.new("Invalid value for limit parameter")
end
@limit = [params[:limit].to_i,
- Rails.configuration.
max_items_per_r
esponse].min
+ Rails.configuration.
API.MaxItemsPerR
esponse].min
else
@limit = DEFAULT_LIMIT
end
else
@limit = DEFAULT_LIMIT
end
@@
-151,7
+151,7
@@
module LoadParam
when String
begin
@select = SafeJSON.load(params[:select])
when String
begin
@select = SafeJSON.load(params[:select])
- raise unless @select.is_a? Array or @select.nil?
+ raise unless @select.is_a? Array or @select.nil?
or !@select
rescue
raise ArgumentError.new("Could not parse \"select\" param as an array")
end
rescue
raise ArgumentError.new("Could not parse \"select\" param as an array")
end