Sha256: 30b555217f51e6c559f7562bdcc60db536d0106525b68e971495850572b76aa6

Contents?: true

Size: 285 Bytes

Versions: 5

Compression:

Stored size: 285 Bytes

Contents

class Comment < ActiveRecord::Base
  belongs_to :post

  def stupid_comment?
    stupid_words = ["very good", "nice"]
    self.body.length < 20 && stupid_words.find { |w| self.body.include?(w) }
  end

  def contains_embedded_links?
    (self.body =~ /<a.*>.+<\/a>/i) != nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
deforest-1.1.1 test/dummy/app/models/comment.rb
deforest-1.1.0 test/dummy/app/models/comment.rb
deforest-1.0.2 test/dummy/app/models/comment.rb
deforest-1.0.1 test/dummy/app/models/comment.rb
deforest-1.0.0 test/dummy/app/models/comment.rb