Skip to content

Instantly share code, notes, and snippets.

@edgarjs
Created June 13, 2013 14:36
Show Gist options
  • Save edgarjs/5774177 to your computer and use it in GitHub Desktop.
Save edgarjs/5774177 to your computer and use it in GitHub Desktop.
How to bypass validations
class User < ActiveRecord::Base
validates_presence_of :email
validates_uniqueness_of :email
end
User.create(email: '[email protected]')
@user = User.new
@user.save # => false
@user.update_attribute(:email, '[email protected]') # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment