fixing tests
This commit is contained in:
@@ -4,15 +4,11 @@ module PostSets
|
||||
attr_accessor :total_pages, :current_page
|
||||
end
|
||||
|
||||
attr_reader :pool, :page, :posts
|
||||
attr_reader :pool, :page
|
||||
|
||||
def initialize(pool, page)
|
||||
def initialize(pool, page = 1)
|
||||
@pool = pool
|
||||
@page = page
|
||||
@posts = pool.posts(:offset => offset, :limit => limit)
|
||||
@posts.extend(ActiveRecordExtension)
|
||||
@posts.total_pages = total_pages
|
||||
@posts.current_page = current_page
|
||||
end
|
||||
|
||||
def offset
|
||||
@@ -27,6 +23,16 @@ module PostSets
|
||||
["pool:#{pool.id}"]
|
||||
end
|
||||
|
||||
def posts
|
||||
@posts ||= begin
|
||||
x = pool.posts(:offset => offset, :limit => limit)
|
||||
x.extend(ActiveRecordExtension)
|
||||
x.total_pages = total_pages
|
||||
x.current_page = current_page
|
||||
x
|
||||
end
|
||||
end
|
||||
|
||||
def tag_string
|
||||
tag_array.join("")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user