1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Declaring the attr_accessor for password_confirmation is not necessary

as the confirmation validation already adds that attr_accessor
This commit is contained in:
Brian Cardarella 2011-04-11 12:18:12 +08:00 committed by David Heinemeier Hansson
parent 7660e7cb4d
commit a8365ab9ad

View file

@ -31,11 +31,10 @@ module ActiveModel
# User.find_by_name("david").try(:authenticate, "mUc3m00RsqyRe") # => user
def has_secure_password
attr_reader :password
attr_accessor :password_confirmation
validates_confirmation_of :password
validates_presence_of :password_digest
include InstanceMethodsOnActivation
if respond_to?(:attributes_protected_by_default)