forum previews working

This commit is contained in:
albert
2011-03-12 16:09:11 -05:00
parent 21cc1cbafa
commit bd520f61f7
29 changed files with 1516 additions and 81 deletions

View File

@@ -7,6 +7,7 @@ class ForumTopic < ActiveRecord::Base
before_validation :initialize_creator, :on => :create
before_validation :initialize_updater
validates_presence_of :title, :creator_id
validates_associated :original_post
scope :title_matches, lambda {|title| where(["text_index @@ plainto_tsquery(?)", title])}
search_methods :title_matches
accepts_nested_attributes_for :original_post