Sha256: fb72c13aab4f1e98c6b508b6ffdf8bb3057fe47becdfadbfc68362a58cbd3c49

Contents?: true

Size: 541 Bytes

Versions: 9

Compression:

Stored size: 541 Bytes

Contents

class Comment < ActiveRecord::Base
  unloadable
  
  belongs_to :commentable, :polymorphic => true

  acts_as_textiled :body => [:hard_breaks, :filter_html, :filter_styles]

  validates_presence_of :name, :comment
  validates_acceptance_of :spam_filter, :accept => true, :on => :create, :allow_nil => false, :message => "believes message to be spam."
  validates_format_of :email, :with => %r{.+@.+\..+}

  attr_accessor :spam_filter

  def website=(url)
    write_attribute :website, url.gsub(/^http\:\/\//, '') unless url.blank?
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
beef-articles-0.3.12 app/models/comment.rb
beef-articles-0.3.13 app/models/comment.rb
beef-articles-0.3.14 app/models/comment.rb
beef-articles-0.3.15 app/models/comment.rb
beef-articles-0.3.16 app/models/comment.rb
beef-articles-0.3.18 app/models/comment.rb
beef-articles-0.3.21 app/models/comment.rb
beef-articles-0.3.25 app/models/comment.rb
beef-articles-0.3.27 app/models/comment.rb