Hi, I''ve used Rails quite a bit. I want to understand the major Rails components well enough to read the Rails source without great struggle. Eventually I''d like to know how all the components are wired together but I''d be happy to start with understanding Active Record thoroughly. For me, the best way to understand something is to build it. I imagine building a simple version of Active Record with just one type of validation, one type of association, and one database adapter. A stripped down Active Record with the same file and class/module structure as the real thing. Does a tutorial about this sort of exercise exist? Would a tutorial about this be helpful for others? Is there anyone who can direct me to the most important parts of Active Record? (I''ve looked through David Black''s book and it doesn''t seem to cover the detail of Rails I''m interested in learning.) Thanks, Peter
Why not just implement some ActiveRecord patches? Seems like a good way to learn how it works while helping improve the code base. On 6/29/06, Peter Michaux <petermichaux@gmail.com> wrote:> Hi, > > I''ve used Rails quite a bit. I want to understand the major Rails > components well enough to read the Rails source without great > struggle. Eventually I''d like to know how all the components are wired > together but I''d be happy to start with understanding Active Record > thoroughly. For me, the best way to understand something is to build > it. I imagine building a simple version of Active Record with just one > type of validation, one type of association, and one database adapter. > A stripped down Active Record with the same file and class/module > structure as the real thing. Does a tutorial about this sort of > exercise exist? Would a tutorial about this be helpful for others? Is > there anyone who can direct me to the most important parts of Active > Record? (I''ve looked through David Black''s book and it doesn''t seem to > cover the detail of Rails I''m interested in learning.) > > Thanks, > Peter > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >
On 6/29/06, Andrew Kaspick <akaspick@gmail.com> wrote:> Why not just implement some ActiveRecord patches? Seems like a good > way to learn how it works while helping improve the code base.Patches could be the result but I''d like to have a solid understanding too. Peter
Pete- I''ve been toying with a few chapters of a book to do just that. About half is API and uses. Then the other half of the book explains *how* it works. And some of the fun/cool tricks going on inside in the guts to make the usibility so simple. But, its quite a while from being done... -hampton. On 6/29/06, Peter Michaux <petermichaux@gmail.com> wrote:> > Hi, > > I''ve used Rails quite a bit. I want to understand the major Rails > components well enough to read the Rails source without great > struggle. Eventually I''d like to know how all the components are wired > together but I''d be happy to start with understanding Active Record > thoroughly. For me, the best way to understand something is to build > it. I imagine building a simple version of Active Record with just one > type of validation, one type of association, and one database adapter. > A stripped down Active Record with the same file and class/module > structure as the real thing. Does a tutorial about this sort of > exercise exist? Would a tutorial about this be helpful for others? Is > there anyone who can direct me to the most important parts of Active > Record? (I''ve looked through David Black''s book and it doesn''t seem to > cover the detail of Rails I''m interested in learning.) > > Thanks, > Peter > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >_______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
With the rate at which Rails is changing and a good chunk of the agile rails book needing quite an overhaul to be updated to the current version, wouldn''t chapters in a book on the actual implementation of (parts of) rails be even more prone to going out of date? Writing a book that contains this information is definitely interesting from a code design perspective, but definitely not from a "this is how things are implemented" in rails perspective. I''ve written rails patches myself (including some for ActiveRecord) and I gained a pretty good understanding from this exercise alone. I still recommend this approach to figuring out how ActiveRecord works; you''ll get to know parts of ActiveRecord quite intimately this way and are always working with current code. Just my 2 cents. On 6/29/06, Hampton <hcatlin@gmail.com> wrote:> Pete- > > I''ve been toying with a few chapters of a book to do just that. > > About half is API and uses. Then the other half of the book explains *how* > it works. And some of the fun/cool tricks going on inside in the guts to > make the usibility so simple. > > But, its quite a while from being done... > > -hampton. > > > On 6/29/06, Peter Michaux <petermichaux@gmail.com > wrote: > > Hi, > > > > I''ve used Rails quite a bit. I want to understand the major Rails > > components well enough to read the Rails source without great > > struggle. Eventually I''d like to know how all the components are wired > > together but I''d be happy to start with understanding Active Record > > thoroughly. For me, the best way to understand something is to build > > it. I imagine building a simple version of Active Record with just one > > type of validation, one type of association, and one database adapter. > > A stripped down Active Record with the same file and class/module > > structure as the real thing. Does a tutorial about this sort of > > exercise exist? Would a tutorial about this be helpful for others? Is > > there anyone who can direct me to the most important parts of Active > > Record? (I''ve looked through David Black''s book and it doesn''t seem to > > cover the detail of Rails I''m interested in learning.) > > > > Thanks, > > Peter > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > >
On Thu, Jun 29, 2006 at 03:26:42PM -0700, Peter Michaux wrote:> I''ve used Rails quite a bit. I want to understand the major Rails > components well enough to read the Rails source without great > struggle. Eventually I''d like to know how all the components are wiredOne approach to get an overview of how ActiveRecord works is to take something basic and fundamental such as ActiveRecord::Base#find and trace the path the code takes. You can more or less read ActiveRecord::Base top to bottom and to get a sense of the basics. Don''t worry about understanding how everything works. Just have a look at everything at once and get it in your head. marcel -- Marcel Molina Jr. <marcel@vernix.org>
I totally agree. That is how I started and learned much. From ActiveRecord::Base you can dig deeper into associations and anything else that interests you. Me, I learned the most when I tried to patch the odd behaviour of STI. I didn''t quite had much success at the time, but I learned much and eventually it got patched. Now some things about it are unclear again and it''s time for me to dig in again. On 6/30/06, Marcel Molina Jr. <marcel@vernix.org> wrote:> > You can more or less read ActiveRecord::Base top to bottom and to get a > sense > of the basics. Don''t worry about understanding how everything works. Just > have a look at everything at once and get it in your head._______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core