tag set presenter

This commit is contained in:
albert
2012-01-14 14:31:09 -05:00
parent bec405df95
commit 673ff02fcf
8 changed files with 37 additions and 40 deletions

View File

@@ -43,6 +43,10 @@ module PostSets
tag_array.size == 1
end
def is_empty_tag?
tag_array.size == 0
end
def current_page
[page.to_i, 1].max
end

View File

@@ -1,6 +1,6 @@
class RelatedTagCalculator
def self.find_tags(tag, limit)
Post.tag_match(tag).limit(limit).select("posts.tag_string").order("posts.md5").map(&:tag_string)
Post.tag_match(tag).limit(limit).select("posts.tag_string").reorder("posts.md5").map(&:tag_string)
end
def self.calculate_from_sample_to_array(tags, category_constraint = nil)