From the course: Ruby on Rails 5 Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

ActiveRecord and ActiveRelation

ActiveRecord and ActiveRelation - Ruby on Rails Tutorial

From the course: Ruby on Rails 5 Essential Training

Start my 1-month free trial

ActiveRecord and ActiveRelation

- [Narrator] ActiveRecord and ActiveRelation are part of the Rails framework that's going to power our models. So before we begin coding on our models let's get a big picture understanding of how they work. Active record, when it's written all lowercase as two separate words refers to a commonly used design pattern for working with relational databases. It's not Rail specific. You could use the active record pattern in any programming language. It's an approach to designing object oriented software. ActiveRecord, when it's written as one word with a capital A and R, refers to the Rails implementation of the active record pattern. Often you can use the terms interchangeably but it's helpful to understand the context and to know the difference. The ActiveRecord design pattern allows you to retrieve database data as objects. And then to work with them in an object oriented way. Not just as static rows of data. If you've ever worked with database data as rows you know it can be…

Contents