From 97b40e1e783c20d67f51b06fcb0d2b585a4997b5 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Tue, 13 Mar 2012 23:21:46 +0530 Subject: [PATCH] Revert "Fixed Issue #2884 ActiveModel::SecurePassword code / rdoc conflict; an elucidated explanation has been provided and ActiveModel en-locale updated to present a less confusing attribute name for 'password_digest' in form errors due to "has_secure_password"" This reverts commit ddbea9474e20a40e80110944c1e3493ba0efe572. Reason: Includes non-doc changes. --- activemodel/lib/active_model/locale/en.yml | 4 ---- activemodel/lib/active_model/secure_password.rb | 13 ------------- 2 files changed, 17 deletions(-) diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml index 1842ba002f..ba49c6beaa 100644 --- a/activemodel/lib/active_model/locale/en.yml +++ b/activemodel/lib/active_model/locale/en.yml @@ -1,8 +1,4 @@ en: - attributes: - # Prevent confusion in form errors due to 'has_secure_password' - password_digest: "Password" - errors: # The default format to use in full error messages. format: "%{attribute} %{message}" diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index 7c529cb67b..e7a57cf691 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -10,19 +10,6 @@ module ActiveModel # a "password_confirmation" attribute) are automatically added. # You can add more validations by hand if need be. # - # Note: the implementation of has_secure_password enforces presence validation - # on the :password_digest attribute rather than on :password, which is - # in fact a virtual reader attribute. However, validates_confirmation_of ensures - # an indirect means of presence validation of :password if the - # :password_confirmation attribute is not nil. - # - # You may want to add presence validation on :password for the benefit of your forms - # - # class User < ActiveRecord::Base - # has_secure_password - # validates :password, :presence => { :on => :create } - # end - # # You need to add bcrypt-ruby (~> 3.0.0) to Gemfile to use has_secure_password: # # gem 'bcrypt-ruby', '~> 3.0.0'