Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { user: { password: "abcd", password_confirmation: "defg" }
- { user: { password: "abcdefgh" } }
- class User < ActiveRecord::Base
- ...
- def update_without_password_confirmation(params={})
- params.delete(:password) if params[:password_confirmation].blank?
- params.delete(:password_confirmation) if params[:password].blank?
- update_attributes(params)
- end
- end
- clas User < AR::Base
- acts_as_authentic do |u|
- u.require_password_confirmation=false # you can also use :if => some_condition
- u.validate_password_field=false
- end
- end
Add Comment
Please, Sign In to add comment