Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/lib/devise/schema.rb b/lib/devise/schema.rb
index f0ff2a1..94296e4 100644
--- a/lib/devise/schema.rb
+++ b/lib/devise/schema.rb
@@ -14,7 +14,7 @@ module Devise
# encrypter password field in 128 characters.
def database_authenticatable(options={})
null = options[:null] || false
- default = options[:default] || ""
+ default = options[:default] || null ? nil : ""
apply_devise_schema :email, String, :null => null, :default => default
apply_devise_schema :encrypted_password, String, :null => null, :default => default, :limit => 128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment