Sha256: e28647df66148270b8e25a19fd983becb22c460f1c2db4c0b91be2a326670ac0

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

= acts_as_filterable

== Description

acts_as_filterable is a small ActiveRecord plugin that was thrown together
to avoid duplicating the same text filtering logic all over the place in a domain model. 

The only filter in place so far is one that will strip everything out of a string except the digit information. You might ask, "Why don't you just change the column type to a numeric one?". That _is_ the right way to go but we were faced with tens of millions of records and a lot of text processing (with a lot of bad data that would be hard to apply a deterministic ruleset to). So putting this in place will avoid the garbage data coming in moving forward.
  
I'd like to expand the ruleset moving forward to support different schemes like decimals and so on.

== Install as a gem:
 
  config.gem "rares-acts_as_filterable", :source => "http://gems.github.com"

== To apply to fields on a model, add the following inside the class body:
 
  filter_for_digits :phone_number, :fax_number

if something is broken or it is missing a feature; you know the deal. Don't be part of the problem.

== Copyright

Copyright (c) 2009 Rob Ares. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_filterable-0.1.4 README.rdoc