implemented forum post controller

This commit is contained in:
albert
2011-01-13 18:16:39 -05:00
parent 523cc9fe02
commit 541163685d
13 changed files with 121 additions and 42 deletions

View File

@@ -7,7 +7,7 @@ class ForumPost < ActiveRecord::Base
after_save :update_topic_updated_at
validates_presence_of :body, :creator_id
scope :body_matches, lambda {|body| where(["text_index @@ plainto_tsquery(?)", body])}
search_methods :body_matches
search_method :body_matches
def editable_by?(user)
creator_id == user.id || user.is_moderator?