fix counts
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
module PostSets
|
||||
class Favorite < Base
|
||||
attr_reader :user, :page, :favorites
|
||||
attr_reader :user, :page, :favorites, :params
|
||||
|
||||
def initialize(user_id, page = 1, params = {})
|
||||
@params = params
|
||||
@user = ::User.find(user_id)
|
||||
@favorites = ::Favorite.for_user(user.id).paginate(page, :limit => params[:limit]).order("favorites.id desc")
|
||||
@favorites = ::Favorite.for_user(user.id).paginate(page, :limit => limit).order("favorites.id desc")
|
||||
end
|
||||
|
||||
def limit
|
||||
params[:limit] || CurrentUser.user.per_page
|
||||
end
|
||||
|
||||
def tag_array
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -16,7 +16,7 @@ module PostSets
|
||||
end
|
||||
|
||||
def limit
|
||||
Danbooru.config.posts_per_page
|
||||
CurrentUser.user.per_page
|
||||
end
|
||||
|
||||
def tag_array
|
||||
|
||||
@@ -12,7 +12,7 @@ module PostSets
|
||||
end
|
||||
|
||||
def limit
|
||||
25
|
||||
CurrentUser.user.per_page
|
||||
end
|
||||
|
||||
def min_date
|
||||
|
||||
Reference in New Issue
Block a user