June 9th, 2009 By: Daniel
So I had this problem with a record that was being saved even though it failed validation:
That one had me stumped for a while until I realized I was carelessly using update_attribute in my custom writer:
And we all know that update_attribute “saves the record without going through the normal validation procedure.”
Everything worked much nicer after I changed the code to:
def card_number=(num) self.crypted_card_number = encrypt(num) end
No comments:
Post a Comment