2
我似乎在我的rails應用程序中破壞了validates_confirmation_of
。我似乎已經破解了validates_confirmation_of
我的模型看起來是這樣的:
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
有效嗎?