Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aptinio/550713 to your computer and use it in GitHub Desktop.
Save aptinio/550713 to your computer and use it in GitHub Desktop.
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