Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Nov 13, 2009
1 parent 56bbe85 commit e2dd188
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ When AR objects are saved, empty fields are saved as '' instead of nil.
- Some validations do not support `:allow_blank=>true`
- Databases can handle `NULL` better & faster than empty strings (especially when using `LIKE`)


Solution
========
Defines an AR `before_validation` that sets empty Strings to nil.


Install
=======
`script/plugin install git://github.com/collectiveidea/clear_empty_attributes.git`
Expand All @@ -27,6 +29,10 @@ to remove any `''` strings/texts from your database.
rake db:clear_empty_attributes
(only works when checked out or installed as plugin)

TODO
====
Should work with update_attribute / write_attribute too

Authors
=======
- [Brandon Keepers](http://opensoul.org)
- [Michael Grosser](http://pragmatig.wordpress.com)

Hereby placed under public domain, do what you want, just do not hold anybody accountable...

0 comments on commit e2dd188

Please sign in to comment.