提交 a8365ab9 编写于 作者: B Brian Cardarella 提交者: David Heinemeier Hansson

Declaring the attr_accessor for password_confirmation is not necessary

as the confirmation validation already adds that attr_accessor
上级 7660e7cb
......@@ -31,11 +31,10 @@ module ClassMethods
# 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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册