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.
Must accomplish the following:
- Able to associate to itself.
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