diff options
author | Philip Arndt <parndt@gmail.com> | 2010-08-09 21:00:30 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-08-09 21:00:30 +1200 |
commit | 832a0e4866cc0dd33dc6c1c4d5dc75e35152e553 (patch) | |
tree | a0bf054d0a59342db9375551bde1e862ede9b430 /app/models/blog_comment.rb | |
parent | e3d873855a65629af599e2611590575b6720c60c (diff) | |
download | refinerycms-blog-832a0e4866cc0dd33dc6c1c4d5dc75e35152e553.tar.gz refinerycms-blog-832a0e4866cc0dd33dc6c1c4d5dc75e35152e553.tar.bz2 refinerycms-blog-832a0e4866cc0dd33dc6c1c4d5dc75e35152e553.zip |
generate additional fields and specify relationships.
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 |