Skip to content

Instantly share code, notes, and snippets.

@chewmanfoo
Created June 25, 2013 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chewmanfoo/5859520 to your computer and use it in GitHub Desktop.
Save chewmanfoo/5859520 to your computer and use it in GitHub Desktop.
struggling with a validator
Completed 500 Internal Server Error in 1867ms
NoMethodError (undefined method `include?' for nil:NilClass):
app/models/user.rb:121:in `svn_password_must_be_acceptable'
...
validate :svn_password_must_be_acceptable
...
def svn_password_must_be_acceptable
unless svn_password.blank?
if svn_password.include?(';')
errors.add(:svn_password, "must be appropriate (no punctuation etc.)")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment