added forum topic/post
This commit is contained in:
7
app/models/forum_topic.rb
Normal file
7
app/models/forum_topic.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class ForumTopic < ActiveRecord::Base
|
||||
attr_accessible :title
|
||||
belongs_to :creator, :class_name => "User"
|
||||
has_many :posts, :class_name => "ForumPost", :order => "forum_posts.id asc"
|
||||
validates_presence_of :title, :creator_id
|
||||
scope :search_title, lambda {|title| where(["text_index @@ plainto_tsquery(?)", title])}
|
||||
end
|
||||
Reference in New Issue
Block a user