* Renamed Post.find_by_tags into Post.tag_match, made into a full fledged scope
* Post.tag_match no longer takes an options hash (use other arel builders instead)
This commit is contained in:
@@ -51,7 +51,7 @@ module PostSets
|
||||
|
||||
def load_posts
|
||||
@count = Post.fast_count(tags)
|
||||
@posts = Post.find_by_tags(tags, :before_id => before_id).all(:order => "posts.id desc", :limit => limit, :offset => offset)
|
||||
@posts = Post.tag_match(tags).before_id(before_id).all(:order => "posts.id desc", :limit => limit, :offset => offset)
|
||||
end
|
||||
|
||||
def load_suggestions
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class RelatedTagCalculator
|
||||
def self.find_tags(tag, limit)
|
||||
Post.find_by_tags(tag, :limit => limit, :select => "posts.tag_string", :order => "posts.md5").map(&:tag_string)
|
||||
Post.tag_match(tag).limit(limit).select("posts.tag_string").order("posts.md5").map(&:tag_string)
|
||||
end
|
||||
|
||||
def self.calculate_from_sample_to_array(tags, category_constraint = nil)
|
||||
|
||||
Reference in New Issue
Block a user