validates_confirmation_of
我的 Rails 应用程序 似乎坏了。
我的模型如下所示:
class Blark
include ActiveModel::Validations
attr_accessor :text
validates_confirmation_of :text
end
这是我使用它时发生的情况:
0 HAL work/nrb-brewery-management % rails c
Loading development environment (Rails 3.2.5)
1.9.3p0 :001 > b = Blark.new
=> #<Blark:0xae2e2d0>
1.9.3p0 :002 > b.text = 'llama'
=> "llama"
1.9.3p0 :003 > b.text_confirmation
=> nil
1.9.3p0 :004 > b.valid?
=> true
为什么b
在这里有效?