aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/blog_comment.rb
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2010-12-03 10:55:09 +0200
committerUģis Ozols <ugis.ozolss@gmail.com>2010-12-03 10:55:09 +0200
commit1d7a814fb1a2e7725bc142dfbf9501cfd909c781 (patch)
tree6c9a28da4605dcf9059b95f142adce73bae26e1b /app/models/blog_comment.rb
parent51095b80910618f7ce5bf1d991f46dd5fab5aa2a (diff)
downloadrefinerycms-blog-1d7a814fb1a2e7725bc142dfbf9501cfd909c781.tar.gz
refinerycms-blog-1d7a814fb1a2e7725bc142dfbf9501cfd909c781.tar.bz2
refinerycms-blog-1d7a814fb1a2e7725bc142dfbf9501cfd909c781.zip
Rails 3 validation style.
Diffstat (limited to 'app/models/blog_comment.rb')
-rw-r--r--app/models/blog_comment.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb
index f608a1a..8ab1cf3 100644
--- a/app/models/blog_comment.rb
+++ b/app/models/blog_comment.rb
@@ -10,9 +10,8 @@ class BlogComment < ActiveRecord::Base
alias_attribute :message, :body
- validates_presence_of :name, :message
- validates_format_of :email,
- :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
+ validates :name, :message, :presence => true
+ validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i }
scope :unmoderated, :conditions => {:state => nil}
scope :approved, :conditions => {:state => 'approved'}