I'm using the kaminari gem for pagination.
I want to only show the 10 most recent items that were added. For the other scopes I can show up to 30.
Here is the index action of the Resources controller:
@filt= params[:filter] || 'no_filter'
@resources = get_resources(params[:category]||=nil).approved.send(@filt).page(params[:page]).per(30)
Here is the scope for the recent Resources added in the Resource.rb model:
scope :recent, order('created_at DESC').limit(10)
Because the per(30) is set for the other scopes it overrides the limit in the :recent scope.
How can I only show 10 for the recent scope?