i have followin the http://ruby.railstutorial.org/
class User < ActiveRecord
attr_accessible ..., :password, :password_confirmation
has_secure_password
validates :password, :presence => true,
:length => { :minimum => 6 }
validates :password_confirmation, :presence => true
....
end
the problem is to create a new user this works fine, both passwords must be present and they need to match, when i update it requires me to provide the password
for example if another controller wants to change any field of User i must provide a password because otherwise i will not be able to update.
how can i formulate a contition to only require password/password_confirmation when creating the model or doing password update ?