Sha256: fa5e877ee4a8c8860512d0f8acc2712a7a4b9a11791cee4b8fe1d2f73920573b

Contents?: true

Size: 321 Bytes

Versions: 3

Compression:

Stored size: 321 Bytes

Contents

class Comment < ActiveRecord::Base
belongs_to :post


  with_options :allow_blank => true do |c|
    c.validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
    c.validates_format_of :url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blogmodule-1.0.2 app/models/comment.rb
blogmodule-1.0.1 app/models/comment.rb
blogmodule-1.0.0 app/models/comment.rb