I'm doing something like this in a simple test script: show_cc = CreditCard.find(account.credit_card_ref, :params => {:salt => salt}) unless show_cc.errors.nil? or show_cc.errors.empty? puts "we gots errors : #{show_cc.errors.to_yaml}" exit end puts "show card : #{show_cc.to_yaml}"
show_cc.credit_card_month = '12' show_cc.iv = salt show_cc.cvv = '999' show_cc.save unless show_cc.errors.nil? or show_cc.errors.empty? puts "we gots errors : #{show_cc.errors.to_yaml}" exit end
puts "updated card : #{show_cc.to_yaml}
CreditCard is a n ActiveResource class. The show_cc.save is done as a create instead of an update. I figured since the show_cc object is first created from a find (show) and then i modify the attributes and do a save I should get an update.
I'm on Rails 2.2. Thanks. Erik