added popular exploration, added order:rank

This commit is contained in:
albert
2011-08-11 15:39:51 -04:00
parent bd51079fc1
commit e42ea9c608
25 changed files with 296 additions and 61 deletions

View File

@@ -8,6 +8,7 @@ class ForumPost < ActiveRecord::Base
validates_presence_of :body, :creator_id
validate :validate_topic_is_unlocked
scope :body_matches, lambda {|body| where(["text_index @@ plainto_tsquery(?)", body])}
scope :for_user, lambda {|user_id| where("creator_id = ?", user_id)}
search_methods :body_matches
def self.new_reply(params)