models episodes
#219
Jun 21, 2010
25 comments
Active Model
In Rails 3 the non-database functionality of Active Record is extracted out into Active Model. This allows you to cleanly add validations and other features to tableless models.
MongoDB and MongoMapper
MongoDB is a document based database engine. Learn how to access it through MongoMapper in this episode.
More on Virtual Attributes
Use a virtual attribute to implement a simple tagging feature. In this episode I show you how to assign virtual attributes through a callback instead of a setter method.
Non Active Record Model
This episode will show you how to make a model which isn't based on Active Record. You may want to do this if a resource isn't backed by the database.
Session Based Model
If you have a lot of logic associated with the data inside a session, you'll need some central location to put this logic. See how to create a session based model in this episode.
scope_out
The scope_out plugin will generate several helpful find methods for you automatically! It's the best way to move the find conditions into your model. Watch this episode for details.
Complex Forms Part 3
In this third and final episode on complex forms I will show you how to edit a project and multiple tasks all in one form. This includes removing and adding tasks dynamically as well. See the show notes for updated code.






