diff options
author | Robby Grossman <robby@freerobby.com> | 2012-07-31 16:16:21 -0400 |
---|---|---|
committer | Robby Grossman <robby@freerobby.com> | 2012-07-31 16:16:21 -0400 |
commit | ad7f9cdf008e1261fdcdc8e8152462f69b48c20d (patch) | |
tree | dbc0121154f4735273a432d624a9412988961915 /activemodel/lib/active_model | |
parent | c10202208982bfa02ffd16d1614992228391d781 (diff) | |
download | rails-ad7f9cdf008e1261fdcdc8e8152462f69b48c20d.tar.gz rails-ad7f9cdf008e1261fdcdc8e8152462f69b48c20d.tar.bz2 rails-ad7f9cdf008e1261fdcdc8e8152462f69b48c20d.zip |
has_secure_password should not raise a 'digest missing' error if the calling class has specified for validations to be skipped.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/secure_password.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index 3eab745c89..dc89efd2d1 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -43,9 +43,9 @@ module ActiveModel if options.fetch(:validations, true) validates_confirmation_of :password validates_presence_of :password, :on => :create + + before_create { raise "Password digest missing on new record" if password_digest.blank? } end - - before_create { raise "Password digest missing on new record" if password_digest.blank? } include InstanceMethodsOnActivation |