How to Create Database Views using the Scenic Gem

Mike Rogers
Mike Rogers
1.5 هزار بار بازدید - 3 سال پیش - In this tutorial we use
In this tutorial we use the Scenic gem to create a Postgres Database View to view the contents of multiple tables at the same time.

Then I make it awesome & test it with RSpec.

Sources

https://github.com/scenic-views/scenic
https://github.com/MikeRogers0-YouTub...

Chapters

0:00 -  What are we going to do
1:41 -  Adding Scenic Gem and Database View
4:20 -  Accessing our Database view like a normal Rails Model
6:22 -  Using a polymorphic relationship to load the original object
11:16 -  Adding a primary key to our Database View
14:46 -  Testing our view with RSpec
19:06 -  Why make models read only
20:36 -  Adding created_at & updated_at fields

Follow Me Online

➡ Blog: https://mikerogers.io/
➡ Twitter: Twitter: MikeRogers0
➡ GitHub: https://github.com/mikerogers0
➡ YouTube: mikerogers0
➡ BuyMeACoffee: https://www.buymeacoffee.com/MikeRogers0
➡ Dev.to: https://dev.to/mikerogers0

#RubyOnRails #AwesomeRubyGems #Postgres
3 سال پیش در تاریخ 1400/04/03 منتشر شده است.
1,573 بـار بازدید شده
... بیشتر