>
> The typecasting for a MySQL attribute to a Ruby class is done in the
>> read_attribute method in
>> the activerecord/lib/active_record/attribute_methods.rb file. In that method
>> you can see they only typecast the value if column_for_attribute returns the
>> column (i.e. if it's defined in the schema for the table).
>>
>
> Excellent info, this little tibdit helps me, too, coming to Rails for a
> mod_perl world where everything is dynamically typed ("1" == 1 etc). The
> typecasting logic of ActiveRecord has been a learning curve.
>

Just to be clear, I'm not a Rails-core developer, I'm just a happy user of
apidock.com.  If you go to apidock.com/rails you can search for Rails
functions, see other user's comments and click "View Source" to see the
methods source.  It's often a good starting point in to trying to read the
Rails source code (which is actually very readable if you know Ruby).

If you read either of the books Ruby Best Practices or Metaprogramming Ruby
you'll be good to go in reading the Rails source code (I'd possibly say the
latter is slightly better for this purpose).

Cheers,


Andy

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to