diff options
Diffstat (limited to 'app/models/blog_comment.rb')
-rw-r--r-- | app/models/blog_comment.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index f943ce1..7c6b51f 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -1,8 +1,12 @@ class BlogComment < ActiveRecord::Base + belongs_to :post, :class_name => 'BlogPost' + acts_as_indexed :fields => [:name, :email, :body] validates_presence_of :title validates_uniqueness_of :title + named_scope :approved, :conditions => {:approved => true} + named_scope :rejected, :conditions => {:approved => false} end |