Hi I have in my user model
attr_accessor :no_password_validation_needed with_options :unless => :no_password_validation_needed do |p| p.validates_length_of :password, :minimum => 6 p.validates_confirmation_of :password end
And from controller I do @user.no_password_validation_needed = false @user.update_attributes(params[:user])
And it works perfectly and now validation happens. If it is @user.no_password_validation_needed = true Then also I get the expected result as now validation not happens
But now when @user.no_password_validation_needed = 2 #or any other value
Now I get unexpected result as validation not happens That is same result when true? Why this?What modification should I make?Please help
Thanks in advance Tom