Skip to content

Instantly share code, notes, and snippets.

@randyjhunt
Created February 4, 2009 22:02
Show Gist options
  • Select an option

  • Save randyjhunt/58367 to your computer and use it in GitHub Desktop.

Select an option

Save randyjhunt/58367 to your computer and use it in GitHub Desktop.
# you can trap for nil entries in validations and validations are simple
# you can always test it with .blank?
# you can always convert nil values to empty strings by simply
# adding .to_s
# i.e.
test = User.new
test.name
=> nil
test.name.to_s
=> ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment