validates :password, :presence => { :on => :create },
:length => { :within => 4..40 }
和
validates :password, :presence => { :on => :create },
:length => { :within => 4..40, :on => :save }
我认为验证的默认值是:on => :save
在 :create 和 :update 上都意味着什么?但是当我用第二个规格替换第一个时开始失败expected valid? to return false, got true
。
发生了什么?