fixes #29: Forum search function returning error

This commit is contained in:
albert
2011-09-15 17:54:12 -04:00
parent dc7fc15755
commit 9f45f0863e

View File

@@ -7,8 +7,8 @@ class ForumPost < ActiveRecord::Base
after_save :update_topic_updated_at
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)}
scope :body_matches, lambda {|body| where(["forum_posts.text_index @@ plainto_tsquery(?)", body])}
scope :for_user, lambda {|user_id| where("forum_posts.creator_id = ?", user_id)}
search_methods :body_matches
def self.new_reply(params)