Simplifying Data with Rails Single Table Inheritance

preview_player
Показать описание
When you build apps with Ruby on Rails, managing a lot of data can be tricky, especially when different parts of your app are similar but not the same.

Rails has a cool feature called Single Table Inheritance (STI) that helps with this. This post explores how to use Rails' single table inheritance, why it's helpful, and other options you might consider if you’re not the biggest fan.

======

💻 Read the written version:

💎 New to Ruby on Rails? Enroll in my course HELLO RAILS:

Additional Links:

P.S. This stuff takes a long time to make but I love to do it. To help me keep at it consider supporting me. If not monetarily, subscribe to the channel or share it with someone!

Рекомендации по теме
Комментарии
Автор

Thanks for the video. Please add a video where we add fields which are not common to all the models

divyanshu.sharma
Автор

I love it thanks for sharing but my question is, do we must have type attribute to use STI? I mean how the model understand type as a Car?

Thanks

meshu_amare
join shbcf.ru