Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 550 Bytes

README.rdoc

File metadata and controls

19 lines (14 loc) · 550 Bytes

acts_as_nullifier

This trivial Rails plugin makes ActiveRecord to store NULL values to the database instead of empty strings. Only :string and :text attributes that allow NULLs are affected.

Usage:

# nullify all nullable attributes except :name
class Group < ActiveRecord::Base
  acts_as_nullifier :except => :name
end

# nullify only :first_name and :last_name
class User < ActiveRecord::Base
  acts_as_nullifier :only => [:first_name, :last_name]
end

Copyright © 2009 Dmitri Goutnik, released under the MIT license.