vrfs-774: added upper bound to the per_page param
This commit is contained in:
parent
c0c6879833
commit
5b1ea983fa
|
|
@ -150,7 +150,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
rel = rel.select(sel_str)
|
||||
perpage = params[:per_page] || M_PER_PAGE
|
||||
perpage = [params[:per_page] || M_PER_PAGE, 100].min
|
||||
page = [params[:page].to_i, 1].max
|
||||
rel = rel.paginate(:page => page, :per_page => perpage)
|
||||
rel.includes([:instruments, :followings, :friends])
|
||||
|
|
@ -256,7 +256,7 @@ module JamRuby
|
|||
.order('created_at DESC')
|
||||
.limit(max_count)
|
||||
if 0 < rel.count
|
||||
yield rel
|
||||
yield(rel)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue