Skip to content

Rails plugin that makes ActiveRecord to store NULL values to the database instead of empty strings.

Notifications You must be signed in to change notification settings

dmtgtk/acts_as_nullifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Rails plugin that makes ActiveRecord to store NULL values to the database instead of empty strings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages