There are two tables - Rubric and Question . Connection many to many. The task is to upload data to the database via seeds.rb . Data is stored in xls. In principle, it is clear how to load the headings - we take all the data from the heading cells, split them by comma, combine and fill in the database. It is not clear how to bind Questions to these created headings. Or somehow make a request to the database? Tell me the correct option.
| β Π²ΠΎΠΏΡΠΎΡΠ° | ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ | ΠΠΎΠΏΡΠΎΡ | Π ΡΠ±ΡΠΈΠΊΠ° | |:-----------|------------:|:------------:|:------------:| | 1 | ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ1 | ΠΠΎΠΏΡΠΎΡ1 | Π½Π°ΡΠΊΠ°, ΠΏΠΎΠ»ΠΈΡΠΈΠΊΠ° | 2 | ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ2 | ΠΠΎΠΏΡΠΎΡ2 | ΠΆΡΡΠ½Π°Π»ΠΈΡΡΠΈΠΊΠ° | 3 | ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ3 | ΠΠΎΠΏΡΠΎΡ3 | ΠΏΠΎΠ³ΠΎΠ΄Π° | 4 | ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ4 | ΠΠΎΠΏΡΠΎΡ4 | Π½Π°ΡΠΊΠ° | 5 | ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ5 | ΠΠΎΠΏΡΠΎΡ5 | Π·ΠΈΠΌΠ°, Π»Π΅ΡΠΎ, ΠΎΡΠ΅Π½Ρ