Sha256: fbf0d3bc724bd0f3016de2bd3d10e8b2c77599e72c95da8de71fd3aa47db95cd

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

= acts_as_filterable

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.

 to 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
rares-acts_as_filterable-0.1.4 README.rdoc