Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (16 sloc) 0.566 kb
ValidatesNonOffensivenessOf
===========================
An ActiveRecord style validation method intended to prevent profanity and other
"offensive" content.
A list of offensive or disallowed words can be edited in lib/offensive_words.yml
Usage:
class Review < ActiveRecord::Base
validates_non_offensiveness_of :body
end
@review = Review.new(:body => "Turd burglar")
@review.valid? #=> false
@review.errors #=> {:body => "can not contain the word 'Turd'"}
==========================
Written by: Bernd Ustorf
Contributons By:
Brandon Keene <bkeene@gmail.com>
Jump to Line
Something went wrong with that request. Please try again.