Skip to content

Instantly share code, notes, and snippets.

@rvanlieshout
Created July 24, 2012 11:06
Show Gist options
  • Save rvanlieshout/3169409 to your computer and use it in GitHub Desktop.
Save rvanlieshout/3169409 to your computer and use it in GitHub Desktop.
validates :name, :presence: true, unless: :password_or_email_changed?
private
def password_or_email_changed?
password_changed? || email_changed?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment