Skip to content

Instantly share code, notes, and snippets.

@maletor
Created April 19, 2010 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maletor/371406 to your computer and use it in GitHub Desktop.
Save maletor/371406 to your computer and use it in GitHub Desktop.
class Comment < ActiveRecord::Base
include Rakismet::Model
belongs_to :post
validates_presence_of :author, :author_email, :content
validates_format_of :author_email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
validates_format_of :author_url, :with => URI::regexp(%w(http https)), :allow_blank => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment