Post#tag_match: clean up read_only param.
* Drop /posts?ro=true param (broken). * Clean up tag_match (rescuing PG::ConnectionBad didn't do anything, we just build the query here, we don't run it).
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module PostSets
|
||||
class Post < PostSets::Base
|
||||
MAX_PER_PAGE = 200
|
||||
attr_reader :tag_array, :page, :raw, :random, :post_count, :format, :read_only
|
||||
attr_reader :tag_array, :page, :raw, :random, :post_count, :format
|
||||
|
||||
def initialize(tags, page = 1, per_page = nil, options = {})
|
||||
@tag_array = Tag.scan_query(tags)
|
||||
@@ -10,7 +10,6 @@ module PostSets
|
||||
@raw = options[:raw].present?
|
||||
@random = options[:random].present?
|
||||
@format = options[:format] || "html"
|
||||
@read_only = options[:read_only]
|
||||
end
|
||||
|
||||
def tag_string
|
||||
@@ -134,7 +133,7 @@ module PostSets
|
||||
elsif raw
|
||||
temp = ::Post.raw_tag_match(tag_string).order("posts.id DESC").where("true /* PostSets::Post#posts:1 */").paginate(page, :count => post_count, :limit => per_page)
|
||||
else
|
||||
temp = ::Post.tag_match(tag_string, read_only).where("true /* PostSets::Post#posts:2 */").paginate(page, :count => post_count, :limit => per_page)
|
||||
temp = ::Post.tag_match(tag_string).where("true /* PostSets::Post#posts:2 */").paginate(page, :count => post_count, :limit => per_page)
|
||||
end
|
||||
temp.each # hack to force rails to eager load
|
||||
temp
|
||||
|
||||
Reference in New Issue
Block a user