Introduction
Welcome
()
How to use the exercise files
()
1. Database Migrations
Create a database
()
Migration shortcuts
()
The change method
()
Write reversible code
()
Irreversible migrations
()
Revert migrations
()
Create a join table
()
Control migration output
()
Dump the database schema
()
Define seed data
()
2. CRUD Methods
Create records with a block
()
Update multiple records
()
Delete multiple records
()
Touch records
()
Toggle attribute values
()
Increment and decrement counters
()
3. Dirty Objects
Track changes to objects
()
Track changes to attributes
()
Restore attributes
()
4. Query Interface
Other find methods
()
Select partial record data
()
Calculations
()
Negative queries
()
Or queries
()
Retrieve records in batches
()
Default scopes
()
Replace scopes and conditions
()
Join tables
()
Distinct records
()
Left join tables
()
Eager loading
()
5. Delegations
Delegate attributes
()
Set a prefix
()
Without a related object
()
6. Callbacks
Callback basics
()
Conditional callbacks
()
Around callbacks
()
Other callbacks and tips
()
7. Associations
Review
()
Use queries with associations
()
Destroy associated records
()
Touch associated records
()
Counter caches
()
Build records on an association
()
Self-referential associations
()
Single table inheritance
()
Polymorphic associations
()
Ex_Files_RubyonRails_ActiveRecord.zip
(3.4 MB)