Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

Ruby on Rails: Get More From ActiveRecord

via LinkedIn Learning

Overview

Get more from Ruby on Rails ActiveRecord and leverage shortcuts and techniques to make database code more efficient.

Syllabus

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
Conclusion
  • Next steps

Taught by

Kevin Skoglund

Reviews

Start your review of Ruby on Rails: Get More From ActiveRecord

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.