i have a question about how validates_presence_of works as it pertains
to a login system. when you create a user for the first time you can
require that both their password and confirmation password are present.
but on subsequent updates to the that record you have to enter a
confirmation password and that’s really annoying.
i’ve been looking around and i’ve seen solutions that like something
validates_presence_of :confirmation_password, :if=>‘required’
where does that “:if” part come from? i mean, how did whoever suggest
that know that they could do that? is that a Rails or a Ruby thing?
any insight into that mechanism would be much appreciated.
thanks in advance,