fix counts

This commit is contained in:
albert
2013-03-22 21:18:13 -04:00
parent 6f5c29df37
commit ee1a70033c
8 changed files with 21 additions and 9 deletions

View File

@@ -1,10 +1,17 @@
module PostSets
class Note < Post
attr_reader :params
def initialize(params)
# don't call super because we don't want to repeat these queries
@params = params
@tag_array = Tag.scan_query(params[:tags])
@page = params[:page] || 1
@posts = ::Post.tag_match(tag_string).has_notes.paginate(page, :limit => params[:limit]).reorder("last_noted_at desc")
@posts = ::Post.tag_match(tag_string).has_notes.paginate(page, :limit => limit).reorder("last_noted_at desc")
end
def limit
params[:limit] || CurrentUser.user.per_page
end
end
end