ActiveRecord: casting and saving

D

Dave Burt

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
 
D

Dave Burt

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top