Skip to content

JuzerShakir/single_table_inheritance

Repository files navigation

Rails Association (Single Table Inheritance)

Here is an article that gives detailed explaination of this association with the following example: “A list of entertainment shows, such as a movie, TV-series or a documentary.”

Movies, TV series, and documentaries have a lot of common features such as name, runtime, release_date, language etc. So instead of creating 3 different tables of these, we create a single table that holds records of all.


❗ What needs to be done?

Must accomplish the following:

  • Able to associate to itself.

📋 Execution

Run the following commands to execute locally:

The following will install required version of ruby (make sure rvm is installed.)

rvm install x
rvm use x
git clone git@github.com:JuzerShakir/single_table_inheritance.git
cd single_table_inheritance
bundle install
rails c

About

A demonstration of Single Table Inheritance (STI) association of rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published