Rails 3 introduces a new query interface for performing finds in Active Record. See how it works along with the changes in named scopes.
The first Aloha on Rails video was just released! The video for Hey… Is That Your Database Crying?, in which Blythe Dunham walks you through tips and tricks for working with your relational database and ActiveRecord
The :include and :joins options for the find method can be a little confusing because they are so similar. In this episode I show specifically when to use which option.
If you need to keep track of a model's history of changes and switch between versions, consider using the vestal_versions gem like I show in this episode.
Last month I noticed the lack of a good ActiveRecord tutorial/screencast that goes from basic to advanced usage (with examples). So, I decided to put together a presentation on ActiveRecord for the Orlando Ruby Users Group.
Who invented ActiveRecord and why
How to use ActiveRecord
Basic model to table mapping
has_many relationships
Magical counter fields
Many to many relationships
has_many => through
Polymorphic relationships
acts_as_taggable
In this first EnvyCast we take a look at several advanced features of ActiveRecord, including:
Loading Large Data Sets
Foreign Keys
Using and Abusing Include
Counter Caching Properly
Polymorphic Associations
Single Table Inheritance
New Rails 2.1 Features
Matt Aimonetti demonstrates his newest plugins: ActiveRecord Backup and MimetypeFu.
Jordan Fowler reveals his new Shadow plugin that tracks attribute and association changes to ActiveRecord objects, making it easy to create activity feeds for your application.
Shorten simple finds considerably and improve readability by using the dynamic find_all_by and find_by methods.
No need to pass foreign keys in find conditions, just do the find through a has_many association.