As for Rails one query to do multiple INSERT into the DB?

How can this be done?
Suppose there is a data array that needs to be inserted and the model Model
June 3rd 19 at 18:56
2 answers
June 3rd 19 at 18:58
Solution
create can accept an array of hashes as the argument.
June 3rd 19 at 19:00
ActiveRecord still alive? - jarret commented on June 3rd 19 at 19:03
Yes - Deon_Stamm66 commented on June 3rd 19 at 19:06
Why complicate if you can just pass an array to create? The response above. - Peggie_Sawayn73 commented on June 3rd 19 at 19:09
then , that passing an array in the create, You will still have a few insert, instead of 1, and You comments have indicated that you wish to make a "query" in the database - Deon_Stamm66 commented on June 3rd 19 at 19:12
Read the description of the gem activerecord-import example - Deon_Stamm66 commented on June 3rd 19 at 19:15

Find more questions by tags Ruby on RailsSQL