How to Use Scopes in Ruby on Rails

Описание к видео How to Use Scopes in Ruby on Rails

In this video you'll learn about how to use scopes in Ruby on Rails!

Exactly what is a scope & why is it useful?

Scopes are created on Rails models to define custom query methods.

For example:

If you want to get a list of books with long titles, or a list of admin users, or orders that you haven't sent out yet.

All of these are great targets for a Rails scope.

The benefits?

You'll make your code cleaner & more reusable.

Read the article:

https://www.rubyguides.com/2019/10/sc...

Learn more by watching more of my videos now, subscribing to this channel if you haven't yet & visiting my website:

https://www.rubyguides.com/

Thanks for watching!

Комментарии

Информация по комментариям в разработке