revamped pool tests
This commit is contained in:
@@ -27,7 +27,7 @@ module PostSets
|
||||
end
|
||||
|
||||
def relation
|
||||
::Favorite.model_for(user.id).where("user_id = ?", user.id).order("id desc")
|
||||
::Favorite.model_for(user.id).where("user_id = ?", user.id).includes(:post).order("id desc")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ module PostSets
|
||||
end
|
||||
|
||||
def posts
|
||||
@posts ||= pool.posts(pagination_options).limit(limit).all
|
||||
@posts ||= pool.posts(pagination_options.merge(:limit => limit)).all
|
||||
end
|
||||
|
||||
def reload
|
||||
|
||||
@@ -10,7 +10,7 @@ module PostSets
|
||||
|
||||
def slice(relation)
|
||||
if before_id
|
||||
relation.where("id < ?", before_id).limit(limit).all
|
||||
relation.where("id < ?", before_id).order("id desc").limit(limit).all
|
||||
elsif after_id
|
||||
relation.where("id > ?", after_id).order("id asc").limit(limit).all.reverse
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user