Savings records that fail validation.
Tuesday, June 9th, 2009 By: DanielSo I had this problem with a record that was being saved even though it failed validation:
cc = CreditCard.new(:card_number => 'invalid') >> cc.save => false >> cc.id => 3
That one had me stumped for a while until I realized I was carelessly using update_attribute in my custom writer:
def card_number=(num) update_attribute(:crypted_card_number, encrypt(num)) end
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

Four Southern Utah entrepreneurs detailed their technology-related
products Tuesday in St. George after receiving grants from a
state-funded economic development organization.
The Utah Science Technology and Research initiative, or USTAR,
coordinated the luncheon in an effort to highlight recent recipients of
its technology comme...