Skip to content
This repository has been archived by the owner on Dec 31, 2018. It is now read-only.

Commit

Permalink
Move pagination out of the model
Browse files Browse the repository at this point in the history
  - The pagination logic is only needed in a single action in a single
    controller, so move it out of the model and into that one action.
  - Because pagination was the only customization that stratify-rails
    made to the Stratify::Activity model, we can remove that file from
    the Rails app altogether. (The core implementation of Stratify::Activity
    remains in the stratify-base gem.)
  - This also restores the desired pagination behavior (i.e., 200 per
    page, as opposed to the default of 25 per page) which got borked in
    commit 4d75b0e.
  • Loading branch information
jasonrudolph committed Oct 30, 2012
1 parent d2f3536 commit f6f06a3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion stratify-rails/app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def index
# TODO Simplify the logic below once this bug is fixed in Kaminari:
# https://github.com/amatsuda/kaminari/issues/145
activity_criteria = Stratify::Activity.desc(:created_at)
@activities = Kaminari.paginate_array(activity_criteria).page(params[:page])
@activities = Kaminari.paginate_array(activity_criteria).page(params[:page]).per(200)
end

def destroy
Expand Down
6 changes: 0 additions & 6 deletions stratify-rails/app/models/stratify/activity.rb

This file was deleted.

0 comments on commit f6f06a3

Please sign in to comment.