Skip to content
Browse files

new regex censors any word longer than 3 chars

  • Loading branch information...
1 parent 9131742 commit 44623de1ea099423e1b57fcf234612a5ca99f891 Pau Santesmasses committed Dec 12, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/post.rb
View
2 app/models/post.rb
@@ -3,7 +3,7 @@ class Post < ActiveRecord::Base
validates_presence_of :post, :email, :name
def censored_post
- self.post.gsub(/(the|a|who|what|I|i|where|huh)/) do |match|
+ self.post.gsub(/\w{4,}/) do |match|
"" * match.length
end
end

0 comments on commit 44623de

Please sign in to comment.
Something went wrong with that request. Please try again.