This commit is contained in:
albert
2013-03-22 09:58:31 -07:00
parent eed3772cdb
commit fd9ca8d2fc
4 changed files with 5 additions and 5 deletions

View File

@@ -2,9 +2,9 @@ module PostSets
class Favorite < Base
attr_reader :user, :page, :favorites
def initialize(user_id, page = 1)
def initialize(user_id, page = 1, params = {})
@user = ::User.find(user_id)
@favorites = ::Favorite.for_user(user.id).paginate(page).order("favorites.id desc")
@favorites = ::Favorite.for_user(user.id).paginate(page, :limit => params[:limit]).order("favorites.id desc")
end
def tag_array

View File

@@ -4,7 +4,7 @@ module PostSets
# don't call super because we don't want to repeat these queries
@tag_array = Tag.scan_query(params[:tags])
@page = params[:page] || 1
@posts = ::Post.tag_match(tag_string).has_notes.paginate(page).reorder("last_noted_at desc")
@posts = ::Post.tag_match(tag_string).has_notes.paginate(page, :limit => params[:limit]).reorder("last_noted_at desc")
end
end
end