ruby on rails - Why update_attribute firing validation? -


I have two disabled text boxes and it's going to be worth zero as a value.

However, update_attribute is firing verification for those text boxes

According to my knowledge, update_attribute should not update a weak column with zero value.

  validates_inclusion_of: text_response_time ,: in = & gt; 0..60,: Message = & gt; "Should be between 0 and 60 minutes." (Rdb: 589) params [: test] [: text_response_time] zero (rdb: 589) @ test.update_attributes! (Paramount [: Test]) ActiveRecord :: record Invalid exception: Verification failed: Text response time should be between 0 to 60 minutes.   

No ideas!

The update attributes always validate the entire object, so why you keep unsuccessful accreditation, your options Either use update_attribute (which will ignore verification) or use conditional verification as described in

Comments