[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ActiveRecord: casting and saving

Dave Burt

3/6/2005 3:15:00 PM

Hi,

How do numbers become Numeric between a call to
ActiveRecord::Base#update_attributes and when the database is hit by
ConnectionAdapters::ConcreteAdapter#update ?

From what I can see,
@record.update_attributes(@params['record'])
sets fields to string values (which you can get using
Base#read_attribute_before_type_cast), and I can't see read_attribute (which
performs a cast) being used on the way to the database.

Can someone explain this?

Cheers,
Dave


1 Answer

Dave Burt

3/6/2005 3:17:00 PM

0

Sorry, rubyists, it's past my bedtime and this should have gone to the Rails
list... not that you're not allowed to answer :) but sorry for the
semi-off-topic post.

Cheers,
Dave