Put an upper limit on the per_page param
This commit is contained in:
parent
f5a03fd6ed
commit
40953d37bd
1 changed files with 1 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ class ApisController < ApplicationController #We should start with this versione
|
|||
|
||||
protected
|
||||
def set_defaults
|
||||
params[:per_page] ||= 20
|
||||
params[:per_page] = 20 if params[:per_page].nil? || params[:per_page] > 100
|
||||
params[:order] = 'created_at' unless ['created_at', 'updated_at'].include?(params[:order])
|
||||
params[:page] ||= 1
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue