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
raise ArgumentError.new("Invalid value for limit parameter")
end
@limit = [params[:limit].to_i,
- Rails.configuration.max_items_per_response].min
+ Rails.configuration.API.MaxItemsPerResponse].min
else
@limit = DEFAULT_LIMIT
end
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